I had the requirement to send a single email while pulling SharePoint Columns into the email. Simple everyday stuff for flow, but one of the columns was a dropdown with allow multiple selections turned on, and then down the deadend search began.
The suggested solution at the bottom of page 2 of this post was the starting point of figuring this out: https://powerusers.microsoft.com/t5/General-Flow-Discussion/SharePoint-list-submission-notification-... .
This solution did send out a single email but the sting produced was a series of odata strings. The epiphany came when I checked the run in Microsoft Flow and I realized it was returning JSON. The working flow is as followed with screenshots below.
1. SharePoint: When item an item is created.
2. Initialize String Variable
3. Apply for each Loop (Multiple Selected Choice Column)
4. Inside Loop | Parse JSON
Here is the schema:
{ "type": "object", "properties": { "@@odata.type": { "type": "string" }, "Id": { "type": "integer" }, "Value": { "type": "string" } } }
5. Inside Loop | Append to String Variable
6. Send an email.
(Repeat steps 2-5 for each Multiple Selected Choice Column)
Solved! Go to Solution.
Hi @endy1175,
I have made a test on my side to create a BizOpp column in my sharepoint list with choice type and allow multiple values.
You could refer to screenshot below to create the flow:
The flow would run successfully as below:
Best regards,
Alice
Hi @endy1175,
I have made a test on my side to create a BizOpp column in my sharepoint list with choice type and allow multiple values.
You could refer to screenshot below to create the flow:
The flow would run successfully as below:
Best regards,
Alice
Hi,
Thank you for your solution, i'm facing the same problem but instead of using "When an item is created" i use get items, so when i choose "Apply to each" for the Choices column, it duplicate "Apply to each"
As you can see in the screenshot, NOC Involved is the field with multiple choices.
So by having two apply to each at the end i get a file with all the choices not just the chosen ones like that :
Any solution please for that ?
@Anonymous
You are getting the double "apply to each" becuase you are selecting a Multiple Selection Column that is part of Get Items. Think of an Array within an Array.
I haven't had a chance to duplicate your requirement but I will give it a shot over the weekend.
Sooooo.... this was interesting. You have to get the JSON of the list, and this is going to be a long post due to the complexity of an Array within an Array.
First Run the flow knowing it is going to fail, to get the JSON of the list.
Review the run of flow, and copy the body of the input
Bulid the start of your flow
Next add the Parse JSON Action
Click the "Use the sample Payload..." and paste in the JSON from the list.
Add another apply to each loop with the name of the column from the previous Parse JSON Action.
Add another Parse JSON and use the JSON from Original Post.
The last step in the child Apply to Each is append to String Variable
Outside of the Child Apply to Each
Add Action to Add Row to Table in Excel where Title is from the the first Parse JSON
"Title" and the value of the the varible
The final Step in the Parent Apply To Each is to Set Varible to Null
This Solution is list composition dependent and not dynamic, meaning the JSON of a list depend on the list columns in the list.
The final results:
Hi @endy1175,
Thank for your solution , but my flow dosn't failed it is just having errors in the output, it give me all the choices in a multi value field not only the chosen ones, so how can i get the JSON code that i have to copy and paste it ?
Thank you so much!!
@v-yuazh-msftHi Alice,
Thanks so much for this super helpful instruction. Got right through something that I thought would take me hours to figure out.
I do, however, still have one question. At the end of the "Append to String variable", you have a comma. Yes, I need that comma, but my output always winds up with a comma at the end of my string which makes it look like information is missing. Is there a way to have it NOT put a comma behind the very last item?
Thank you so much!