Sync all people from 4me Directory with pagination
Recipe ToolsCustomer ServiceIT Service Management
What it does
When someone calls this automation, it retrieves all people from a 4me Directory Account in batches of 100. It loops through each page and returns the complete list so nothing is missed.
Who it's for
IT teams who need to sync all people from 4me Directory into another system or report.
How teams use this
Sync 4me people to a data warehouse
Pull all people from 4me Directory in one call and load them into a data warehouse for reporting. The pagination is handled automatically so large accounts sync completely without manual batching.
Feed people into an HR system
Call this automation from an HR system to import all 4me Directory people at once. The complete roster arrives in a single response, making it easy to sync without writing pagination logic elsewhere.
Filter people by a custom field before returning
Add a condition inside the loop to check a custom field and only include people who match. The result list then contains only the filtered people, reducing downstream processing.
How it works
- Call the function. A function call starts this automation to retrieve all people from the 4me Directory Account.
- Query people in batches. Fetch the first 100 people from 4me Directory and get pagination info to know if more pages exist.
- Add people to the result list. Collect each batch of people into a single list as the automation loops through pages.
- Loop until all pages are done. Repeat the query and add steps for each page until the pagination info shows no next page remains.
- Return the complete list. Send back all people from every page so the caller has the full Directory Account roster.