
Announcements
Hello -
I am making a call to a REST API that returns objects with one of the fields being an ID. I need to then take these IDs and make an additional api call, 1 per id, passing these ids as a parameter.
For example, the initial API Call returns 10 ids. I need to take each id and make the same API call 10x, passing a different id each time.
How would i set this up?
@thampton You will need a parent/child flow configuration. The parent flow will have the action to call the REST API that returns the IDs. You can pass a single ID by looping or all the IDs to a child flow using HTTP POST where the URI/URL is the child flows URL.
Above example, I'm passing 3 parameters to a child flow. The child flow is triggered by an HTTP Request with a json schema to receive the 3 parameters being passed from the parent.
When you create a flow triggered by an HTTP request the URL will be generated after you save. This is the one you will need to use in the parent as a reference to call the child.
Also depending on how you want the IDs to be processed, you can either pass one ID from the parent to the child, or pass all IDs all at once and have the child loop through the IDs instead rather than the parent looping. It really depends on what you're trying to do and where it makes sense.
In my case, I have a child that sends an adaptive card to different users waiting for a response so I have to pass one record to the child each time so each is it's own workflow.