odata_query
Run OData queries on SAP SuccessFactors with automatic pagination and effective-date handling, saving results to JSON for analysis.
Instructions
Run an OData query, following next links until exhausted or max_pages.
path is the entity set and may carry query options, e.g. "FOCompany" or
"EmpJob?$select=userId,jobCode" (v4 tenant: service root first,
"talent/cdp/Learning.svc/v1/Items") — those are parsed out of path and merged
into the request; pass options either way, but prefer params (params win
on conflicts). Always $select only the fields you need. Effective-dated
entities (EmpJob, Position, FO*, MDF) return ONLY today's time slice unless
you pass fromDate=1900-01-01 and toDate=9999-12-31 (or asOfDate) in params.
Scope with a population filter pushed through navigation in $filter
(e.g. personNav/employmentNav/jobInfoNav/company in (...)) rather than
pulling whole entity sets — see the server instructions.
When max_pages > 1 and no $orderby is given, one is added from the
entity's key properties (reported as orderby_added) so $skip paging
can't duplicate or skip rows; if keys are unknown or unsortable, or SF
rejects it, the query runs without and a warning says so — then pass
$orderby yourself. Same condition, without $top/$skip, also adds
paging=snapshot on v2 (reported as paging_added); if SF rejects it for
that entity, the retry drops it and warns. Rows are checked for
duplicate keys when every key field is in the records (duplicate_records
warning if found). A final page exactly $top-sized with no next link gets a truncation warning (some MDF entities stop early); resume with $skip and an explicit $orderby.
Records are written to a JSON file; the tool returns counts, the field names of the first record, and the path. preview accepts 0-20; values above zero return that many records inline only when their serialized UTF-8 size is at most 16 KiB. Otherwise, inspect the saved file locally.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| params | No | ||
| preview | No | Inline records; maximum 20. | |
| max_pages | No | ||
| company_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||