cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoeO
Level: Powered On

Excel for-each to match data with SQL

Im looking to have a Flow which would import data from Excel into SQL. However, i need to perform two sperate steps for when the Row (sql record) exists or is modified with updated data from Excel. I know i could easily create conditions, and then search SQL based on a specific columns, but i cant seem to figure out how to perform a for-each to have Flow cycle through each row. I would need for Flow to get the Excel Row, then i would get the SQL Row with a condition, then (i assume) i would use the "length()" expression to count the number of retrieve records (to determine whether its a new or existing record.

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: Excel for-each to match data with SQL

Hi @JoeO ,

 I have made a test on my side, please take a try with the following workaround:

I suggest you use the empty() function.

The expression is: empty(body('Get_rows')?['value']) is equal to true.

Capture4.PNG

 

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
JoeO
Level: Powered On

Re: Excel for-each to match data with SQL

Im thinking something like the Flow below. Would appreciate if one could confirm its correct. If the record in question exists, ill use the "Yes" step, if not, the "No" step

 

ExcelToSQL.png

 

v-zhos-msft
Level 10

Re: Excel for-each to match data with SQL

Hi @JoeO ,

 I have made a test on my side, please take a try with the following workaround:

I suggest you use the empty() function.

The expression is: empty(body('Get_rows')?['value']) is equal to true.

Capture4.PNG

 

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 130 members 4,733 guests
Please welcome our newest community members: