cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jonathanO
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
v-micsh-msft
Community Support
Community Support

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
v-micsh-msft
Community Support
Community Support

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (40,425)