cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

Hello.

 

I'm creating a flow with MS Flow. Is bascically a SharePoint List, which would trigger and approval action, whenecer a new item is created. The problem is that some colunms of my SharePoint lists are multiple choices/dropdown menu, therefore, when I start to use the dynamic content, the APPLY TO EACH is activated...

 

How can I disable this? I just want to the variable values appear in the approval requirement email, without the APPLY TO EACH action.

 

Thank you!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

@renatomedeiros_:

 

Flow is adding a for each loop because the choice can have multiple values.

 

To avoid the loop when you send the email try the following:

  1. Declare a string variable
  2. Loop through the values selected in the Choice column
  3. Append each value to the string followed by a separator (,) and probably a space
  4. Reference the variable when sending the email rather than the actual choice column.

The flow below runs successfully.

Choice1.jpgChoice2.jpg 

 

If this solves your issue, please mark your question as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

@renatomedeiros_:

 

Flow is adding a for each loop because the choice can have multiple values.

 

To avoid the loop when you send the email try the following:

  1. Declare a string variable
  2. Loop through the values selected in the Choice column
  3. Append each value to the string followed by a separator (,) and probably a space
  4. Reference the variable when sending the email rather than the actual choice column.

The flow below runs successfully.

Choice1.jpgChoice2.jpg 

 

If this solves your issue, please mark your question as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Administrator
Administrator

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

Hello, @renatomedeiros_!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @ScottShearer‘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
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
Highlighted
Frequent Visitor

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

Hi Scott,

I also have the same issue on "apply to each". My scenario has no approval but only sending an email notification when a new item is added or modified on sharepoint lists. I've tried adding string variable but still the "apply to each" is auto added on the flow. I have multiple recipients on the email and values on email body.

Hope you can help.

Thank you,

Jhun

Highlighted
Frequent Visitor

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

here are the screenshots

 

flow issue 1.PNGflow issue 2.PNG

Highlighted
Frequent Visitor

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

@ScottShearer and @GabrielStJohn hope you can help. Thanks

Highlighted
New Member

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

This worked like a charm for me, but, how do I tell it to eliminate the last comma in the string when nothing comes after it?

Highlighted
Super User
Super User

Re: HOW TO REMOVE APPLY TO EACH FOR SHAREPOINT APPROVAL FLOWS LISTS WITH MULTIPLE CHOICES COLUNMS

@whittakm :

 

Take a look at a sample Flow below.  It takes a string and rips off the last comma

 

Trim1.jpg 

 

Here is the expression I use when setting the second variable:

Trim2.jpg 

The expression finds the index of the last comma and takes all charatcters in the string upt to that point.

 

Here is a screen shot from the run history. 

 

Trim3.jpg  

 

Post here if you have any questions.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

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