cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radek1
Regular Visitor

Creating a new variable with output of HTTP API call in each loop in Do Until loop

Hello,

 

I am trying to fetch a data from API in Do Until step. The idea is to run the loop n times, n can reach up to high numbers like 3000, each time the HTTP API query would fetch an output which I would like to save in a new variable, then increment n by 1. I was thinking about initializing a variable before the Do Until with blank value and make the name of the variable depend on n but apparently I cannot use expressions in the name field:

 

Radek1_0-1626869621157.png

 

The outputs are in json. While I am stuck at this part already, my next goal would be to merge them all together into one json as they have the same schema. I believe union() expression can help me achieve that but then another issue might occur - how to list all outputs in the union() expression if their number might vary.

 

Radek1_1-1626869982484.png

 

If it is possible to avoid any additional loops that would be great.

 

Appreciate if I could get some ideas from you all. 

1 REPLY 1
eric-cheng
Solution Sage
Solution Sage

Hi @Radek1 ,

 

You can look into appending each response into an array variable.  

 

The Do Until action allows you to set the iterations without incrementing a counter manually.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,040)