Conditional Loop - paginated results

Intacct is limited to 1000 results on any api query. If your results are over that you are returned a line like so…

<result>
	   <status><![CDATA[success]]></status>
	   <function><![CDATA[readByQuery]]></function>
	   <controlid><![CDATA[testFunctionId]]></controlid>
	   <data listtype="sodocumententry" count="1000" totalcount="1385" numremaining="385" resultId="7765623331XEnTOsCoA4MAAF9Bn2AAAAAI4"> 

Then you would need to use another call to “readmore” using the resultID.

Is there a module that can use the results of a query (specifically the value of numremaining) to determine a loop and then if it loops run another module or assembly to query the api again and append the results to the stream?

I found the fetch paginated results but since the original query was <readByQuery each additional is <readMore I did not see a way to set it up properly.

Any help is appreciated

There are two baseline modules that support fetching paginated results:

Fetch Paginated Results - Breadcrumbs
Fetch Paginated Results - Iterator

If the API doesn’t support either of those standard mechanisms, you need to do it yourself. How you do that will depend on how the API does pagination. Generally you will use a Loop module with an embedded subassembly to fetch the next page of results.

Here is an example in dev.apiant for MINDBODY: 227de1a93af849ee84e58018aad95324

That is what I thought. So to my understanding the loop modules use incoming data not result to determine if it should loop, right?

How would you set a condition of the value in numremaining determines the loop?

Right, the Conditional Loop module only uses incoming data for the logic test.

You can use the Break Loop module and perform a logic test with result data within the nested subassembly to break the loop. But the trick becomes how to tell the subassembly to fetch the next page. Generally you have to have an incrementing page number passed to the subassembly.

See the MINDBODY assembly I referenced for an example.

had a follow up question. opening a new ticket