Forum Discussion

PBIINSANE's avatar
PBIINSANE
Frequent Visitor
3 years ago

Make API calls based on last id from previous call

Hello! Need help with API calls. Is it possible to make api calls based on last id field returned from previous call? For example:

Fitst Call returns 250 records (max limit). Checking rule if there 250 or more records returned, then expand id field, grab the last one and make next call with parameter since_id=last id from previous call (this parameter allowed in Shopify source), else do nothing.

Then checking again count of returned records for second call and apply the same rule for it. So, if there're >=250, then grab last id and do a new call. Iterate until call returns <250 records. Then combine all returned data into one table.