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

Stop flow adding apply to each

Hi all, 

 

I'm building a flow with a Send an Email action, and in the body I am trying to include a few metadata fields from a document 

 

When a document is added to a library, send an email 

email body contains several metadata fields from the document

 

One of the fields is a managed metadata field with multiple selections enabled. 

 

As soon as I add that metadata field, Flow automatically creates a For Each action based on that metadata. 

I am not interested in a For Each action, because I don't want to do anything based on the terms in that field. I just want to display them in an email. 
Any idea on how to get Microsoft to STOP trying to be so helpful?

I need to not have that Apply to Each. 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Stop flow adding apply to each

Hi @SylvieLet17,

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

Best regards,

Alice

View solution in original post

10 REPLIES 10
Highlighted

Re: Stop flow adding apply to each

HI @SylvieLet17,

 

This happens when you add an element form an array. If you want to avoid this then you will have to make sure that you don';t take data our of an array. So for ewxample first collect the right element out of the array and convert it into a simple piece of data before you use it. 

Highlighted
Community Support
Community Support

Re: Stop flow adding apply to each

Hi @SylvieLet17,

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

Best regards,

Alice

View solution in original post

Highlighted
Administrator
Administrator

Re: Stop flow adding apply to each

Hello, @SylvieLet17!

Have you had an opportunity to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager
Power Platform Communities
Highlighted
Frequent Visitor

Re: Stop flow adding apply to each

Thanks Alice!

Oh my gosh. After looking around for answers on any number of problems with my PowerApp form and Flow I was getting used to hour long efforts to find answers.  This was perfect and I was able to follow it easily.

David

Highlighted
Advocate I
Advocate I

Re: Stop flow adding apply to each

@Pieter_Veenstra 

what do you do if the whole point of the flow is to take data out of an array then? I was planning on using a do until loop partnered with apply to each, but because of the settings I can't do the do until first. Isn't it a little silly to make someone make a new flow instead of just having an checkbox option to get rid of the automatic apply to each?

@Pieter_Veenstra wrote:

HI @SylvieLet17,

 

This happens when you add an element form an array. If you want to avoid this then you will have to make sure that you don';t take data our of an array. So for ewxample first collect the right element out of the array and convert it into a simple piece of data before you use it. 


Highlighted

Re: Stop flow adding apply to each

@j_hermes , The apply to ewach simply happens when you proces an array. If you know that the array only holds one item you can avoid the additonal apply to each by using the first fucntion on the array, giving you a single item

Highlighted
Advocate I
Advocate I

Re: Stop flow adding apply to each

I have a flow working off of an http request and if there's multiple rows in the array it adds all the array data for each row instance. What can I do to fix this?

Highlighted
Frequent Visitor

Re: Stop flow adding apply to each

how do I do that please? if i've added a filter and then I just want to extract the first item of that filtered array, what's the syntax to use for this? 

Thanks

Highlighted
New Member

Re: Stop flow adding apply to each

I'm having the opposite problem. Per this article, I'm expecting Power Automate to automatically generate an "Apply to each," but it doesn't. When I add one manually, it doesn't generate the "List of response notifications Response ID" variable I need to use to populate the "Select an output from previous steps" item.

 

  1. Was the auto-generate functionality removed?
  2. If so, and I manually create it instead, how do I put the variable I need back into it?
Highlighted
New Member

Re: Stop flow adding apply to each

OMG. After spending days trying to get rid of nonsense code in the approval emails, this is the solution that resolved everything! Yes! Thank you so much. Now my multi-select form field data appears without garbage code in the email. Managers don't want to see that.

Super grateful!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,163)