cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to loop through all the rows in a table from azure SQL database

I have a table which contains Id, base currency and other currency columns. my requirement is to get all the rows in the table one by one and get corresponding exchange value from an API and insert into another table. I have hardcoded and able to achieve this for one row in flow but how to do it for all rows in a table. In azure sql server we could write a stored proc and a cursor to fetch all rows in table one by one. I need similar operation in microsoft flow.  Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

You could use Apply to each to fetch all rows in table one by one. For example:

Screenshot 2020-10-19 132606.jpg

To extract each property, you could use expression to get current item value, for example: 

item()?['columnName'] 

For more information, please refer to this document: 

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#item 

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

You could use Apply to each to fetch all rows in table one by one. For example:

Screenshot 2020-10-19 132606.jpg

To extract each property, you could use expression to get current item value, for example: 

item()?['columnName'] 

For more information, please refer to this document: 

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#item 

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Amanthaper
Responsive Resident
Responsive Resident

Hi @Anonymous ,

This post https://powerusers.microsoft.com/t5/Building-Flows/Rerun-Flow-with-different-variables/m-p/717670#M98042

does something similar which may be able to help.

 

Cheers,

Aman

------------------------------------------------------------------------------------------------------
If my post helps you with your problem or answers your question, please mark it Solved or Answered. This helps anyone with similar challenges. If you like my response, please give it a Thumbs Up.
------------------------------------------------------------------------------------------------------

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,736)