How to overcome for eachloop on list rows in powerautomate

| Muhammad Yaseen

If you use List rows connector in your flows you will noticed it will normally get more than 1 row if data available. So whenever you use the values coming from this list rows connector it will automatically be under for each loop which is sometime unnecessary, if firstname is a unique column in your contacts table, if you filter rows like

Firstname eq ‘somename’

Power Automate will wrap the output of this list rows in Apply to each loop.

For Example:

We use Contacts table in list rows connector.

overcome for each loop

The output value First Name we use in the compose connector. It is automatically be wrapped in Apply to each loop.

To overcome this issue we can use expression “first” or “last” according to our need.

Expression is

First/Last (output from your list of rows)? [‘Column Name’]

Or

In this way you will overcome unnecessary looping.

Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.


M
Chief Architect, Founder, and CEO - a Microsoft recognized Power Platform solution architect.

About The Blog

Stay updated with what is happening in the Microsoft Business Applications world and initiatives Imperium is taking to ease digital transformation for customers.


More About Us

We provide guidance and strategic oversight to C-Suite and IT Directors for on-going implementations. Feel free to give us a call.

1 331 250 27 17
Send A Message

Ready to Start?

Get a personalized consultation for your project.

Book a Meeting