Microsoft Graph API Paging

I am trying to make a flow to grab all the compliment devices from micorosoft graph using graph API. I have been able to get the bearer token, and the first 100 devices. The Microsoft Graph API only produces 100 devices at a time. The data that will come in will live in the “@odata.context” and if there is additional pages, we will see a “@odata.nextlink”. I’m not seeing a way to do a loop until or loop while structure. I am guessing I need to spin off a different flow. Let me know if the system can read an item from a loop and continue the loop with new information.

You’re right, there is currently no way to Loop Until. The workaround for this is to have the loop as a separate flow that starts with a Webhook Trigger and ends with a Branch that validates the condition and sends an HTTP request to itself using the Webhook URL if the condition holds true.

awesome, how would i pass the data back to the main flow and pass the bearer token to a new flow?

Any webhook can be called synchronously (this means the requester will wait for the output rather than leaving it to work in the background) by adding sync to the webhook’s URL.

Please keep in mind:

  • This slow down your flow because all of these requests will keep waiting execution.
  • Sync requests are not optimal by our design, because most automations typically run asynchronously.
  • Instead of returning data to the original flow, consider using the Storage piece to add the data to. This way you don’t have to worry a lot about how to return the data in a recursive manner.

Regarding passing data to the webhook, when you send the HTTP request to the webhook, you can include any data in the body of the POST request.

If anything is not so clear, let me know and I can help further.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.