cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

SharePoint Multiple Section Choice Column in MS Flow

Hello,

 

I am designing a flow which sends an email to a person containing data from a SharePoint list item (trigger being when a new item is created)

 

One of the columns in the list is a multiple section choice.

 

When multiple answers are select the flow will repeat the action of sending an email for every individual answer chosen in the choice column.

 

Is there a way to group these answers together so only one email is sent out per item in the list?

 

Thanks

Liam

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @Anonymous of course 🙂

 

In my example, I have used a "When an item is created" trigger, but I could get a list item from another trigger or from an action. On my list I have a choice field called "MultipleChoice" which has three choices: Choice 1, Choice 2 and Choice 3. My users can select multiple options.

 

I'll show you my Flow and then I'll explain it.

MultiChoice.PNG

I have first all used the "Initialize variable" action to create a variable which I can push data into. As the data I'm going to put in is textual, I have declared it to be a string. The name which I have given to the variable  is Selected Choices, but notice that I haven't given it a value. This is because there could possibly be multiple items being put into this, and I can only initialize a variable once.

 

So I then added the action "Append to string variable" action, and selected "Selected Choices" as my variable (in the name dropdown). In the Value, I selected my choice field value from Dynamic Content, i.e. MultipleChoice Value. Flow recognises that this could have multiple values, therefore it will automatically surround it with with an "Apply to each" loop, which is behaviour which you've probably already seen. Each time it loops round, it will put another choice on the string. So if I selected Choice 1 and Choice 3in my list it would go something like this:

 

Start: ""

Loop 1: "Choice 1"

Loop 2: "Choice 1 Choice 2"

 

Once you get used to how this is working you could then include some HTML in this as well so each time it loops round you could put a <br> at the end to force the next option onto a new line.

 

Then when I put together my email body, I just put the "Selected Choices" variable into the text, and it will push out whatever has been added.

 

 





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Hi @Anonymous 

 

The best way to approach this is to Initialize a Variable before your start your loop, e.g. a Variable called Options, which is a String. Within your loop, use the Append to String Variable to add each selected option. E.g. Loop 1 will add "Option 1", loop 2 will add "Option 3" etc

 

Then within your email, include the variable in your email body, so that you will only send one email, but include all of the options which have been selected.





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

Highlighted
Anonymous
Not applicable

Thank you for your solution.

 

Could you go into more detail about how to set up the 'Append to string variable'.

 

I have never used this action before and not sure what data to enter where.

 

Thanks again 

Liam

Highlighted
Anonymous
Not applicable

I tried it out but when the email comes the data is displayed like this.Untitled.png

Highlighted

Hi @Anonymous of course 🙂

 

In my example, I have used a "When an item is created" trigger, but I could get a list item from another trigger or from an action. On my list I have a choice field called "MultipleChoice" which has three choices: Choice 1, Choice 2 and Choice 3. My users can select multiple options.

 

I'll show you my Flow and then I'll explain it.

MultiChoice.PNG

I have first all used the "Initialize variable" action to create a variable which I can push data into. As the data I'm going to put in is textual, I have declared it to be a string. The name which I have given to the variable  is Selected Choices, but notice that I haven't given it a value. This is because there could possibly be multiple items being put into this, and I can only initialize a variable once.

 

So I then added the action "Append to string variable" action, and selected "Selected Choices" as my variable (in the name dropdown). In the Value, I selected my choice field value from Dynamic Content, i.e. MultipleChoice Value. Flow recognises that this could have multiple values, therefore it will automatically surround it with with an "Apply to each" loop, which is behaviour which you've probably already seen. Each time it loops round, it will put another choice on the string. So if I selected Choice 1 and Choice 3in my list it would go something like this:

 

Start: ""

Loop 1: "Choice 1"

Loop 2: "Choice 1 Choice 2"

 

Once you get used to how this is working you could then include some HTML in this as well so each time it loops round you could put a <br> at the end to force the next option onto a new line.

 

Then when I put together my email body, I just put the "Selected Choices" variable into the text, and it will push out whatever has been added.

 

 





Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

View solution in original post

Highlighted
Anonymous
Not applicable

Thank you so much for explaining. Works perfectly. 

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.

Users online (7,221)