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

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
Community Support Team
Community Support Team

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.
1 REPLY 1
Community Support Team
Community Support Team

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.

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!

Top Kudoed Authors
Users Online
Currently online: 68 members 4,468 guests
Please welcome our newest community members: