cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Prevent Flow from adding an "Apply to Each" step around an action that uses result from "Get Rows"

I do not have primary key for a few tables in a flow I am building.  I use SQL - Get Rows to query to find the record I need.  The result will always be one record since I am using Top Count of 1.

 

When I try to use the result from the Get Rows action, Flow will treat the result as an array and force a "Apply to Each" step around the result, even though there is only one item in the result set.

 

The issue is that I have multiple tables I am getting data from using Get Rows and some of the subsequent Get Rows use data to query from the previous Get Rows.  This causes a nested foreach which PowerApps will not allow.

How can I get Flow to treat the result as a single item and not add a "Apply to Each' when I use result?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Prevent Flow from adding an "Apply to Each" step around an action that uses result fro

Hi @jonathanO,

 

We could take use of expression to get the Array elements.

For example:

21.PNG

 

The expression:

first(body('Get_rows')?['value'])

For more details, please check:

WorkFlow Definition Language

 

Regards,

Michael

Community Support Team _ Michael Shao
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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Prevent Flow from adding an "Apply to Each" step around an action that uses result fro

Hi @jonathanO,

 

We could take use of expression to get the Array elements.

For example:

21.PNG

 

The expression:

first(body('Get_rows')?['value'])

For more details, please check:

WorkFlow Definition Language

 

Regards,

Michael

Community Support Team _ Michael Shao
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

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (10,292)