cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cadone
Helper V
Helper V

Remove apply for each

Hi,

The flow gives me apply to each for the user name. i know its only 1 person with that username. How to remove that unwanted apply to each?

cadone_0-1605618542589.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Community Champion
Community Champion

Hi @cadone 

The return data type is an array, even if an array only contains one item it's still an array and therefor when you use the dynamic data it will always add an 'Apply to each' loop

You need to use the first() expression to stop the 'Apply to each' loop from being created , for example:

1.jpg

Expression:

first(outputs('Search_for_users_(V2)')?['body/value'])?['DisplayName']

To obtain a different value you need to change the 'DisplayName' for your desired property:

2.jpg

HTH

Jay

View solution in original post

1 REPLY 1
Jay-Encodian
Community Champion
Community Champion

Hi @cadone 

The return data type is an array, even if an array only contains one item it's still an array and therefor when you use the dynamic data it will always add an 'Apply to each' loop

You need to use the first() expression to stop the 'Apply to each' loop from being created , for example:

1.jpg

Expression:

first(outputs('Search_for_users_(V2)')?['body/value'])?['DisplayName']

To obtain a different value you need to change the 'DisplayName' for your desired property:

2.jpg

HTH

Jay

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,547)