cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Microsoft Flow combining Multiple Values from a SharePoint Dropdown Column

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)

 

FlowMultiSelectionColumn_1.PNGFlowMultiSelectionColumn_2.PNGFlowMultiSelectionColumn_3.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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:

Capture.PNG

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

View solution in original post

8 REPLIES 8
Community Support
Community Support

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:

Capture.PNG

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

View solution in original post

Anonymous
Not applicable

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"

 

Capture.PNG

 

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 :

 

Capture2.PNG

 

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.

@Marwa1

 

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 

DArray1.PNG

 

Bulid the start of your flow

DArray2.PNG

Next add the Parse JSON Action

Click the "Use the sample Payload..." and paste in the JSON from the list.

DArray3.PNG

Add another apply to each loop with the name of the column from the previous Parse JSON Action.

DArray4.PNG

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 

DArray5.PNG

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

DArray6.PNG

The final Step in the Parent Apply To Each is to Set Varible to Null

DArray7.PNG

 

This Solution is list composition dependent and not dynamic, meaning the JSON of a list depend on the list columns in the list.

DArray8.PNG

 

The final results:

DArray9.PNG

 

 

 

 

 

 

 

 

 

 

 

 

@v-yuazh-msft

 

thank you but I was not lookig for a solution but I was giving a solution.

Anonymous
Not applicable

Hi @endy1175,

 

Thank for your solution Smiley Happy , 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!  

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (63,918)