You are here:
Page Through Sorted Data Using Offsets
If an Omnistudio Data Mapper Extract is expected to retrieve numerous records, you can use paging to retrieve a few at a time based on OFFSET values. For example, you can page through Contacts by last name.
Paging through results requires creating the ORDER BY, OFFSET, and LIMIT settings for extraction.
-
For LIMIT, specify how many records to retrieve at a time.
-
For OFFSET, specify a multiple of the LIMIT value.
-
Optional but recommended for predictable results: Use the ORDER BY setting to sort the data based on a specific field.
Create Settings
| Field | value | notes |
|---|---|---|
| Interface Type | Extract | |
| Input Type | JSON | If using with another Omnistudio component such as an Omniscript, set the input as JSON. |
| Output Type | JSON |
Extract Settings
Map the extracted object with the path in the JSON. To show how you can filter results based on a field, this example lists only contacts who can be called.
| Extraction Object | Extract Object Path | Filter |
|---|---|---|
| Contact | Contact | DoNotCall = "false" |
For ORDER BY, enter LastName as its value. Then,
choose LIMIT and add a value of 3. Finally, choose
OFFSET, and enter AfterRecord as its value.
Mapping Settings
Map the input data to a JSON node so that an Omniscript (or other component) can access the data. To define a data transformation, you can add key-value pairs. This addition replaces the defined key with the value in the output.
| Extract JSON Path | JSON Output Path |
|---|---|
| contact:FirstName | FirstName |
| contact:LastName | LastName |
| contact:Phone | Phone |
Extract Preview
In Preview, add AfterRecord as the key and 0 as the
value. Execute the Data Mapper to retrieve the first page of Contact records.
Change the AfterRecord value to 3 (equal to the LIMIT
value), and execute again. The second page of Contact records is retrieved.

