web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using options from mul...
Power Automate
Suggested Answer

Using options from multi-choice select column in Power Automate Variable to be used parameter

(1) ShareShare
ReportReport
Posted on by 44
I have an Automate flow that is doing the following:
 
 
 
On the Get Items, I want to pull some selected options from a multi choice column in the reported incidents list, store the values in a variable and the use the values in a parameter in an email. When I try and store these values in an Initialise Variable step, if I set the column it puts the step into an Apply For Each which is not allowed. If I don't set the variable value there, but then use the Append to Variable step and set the column to be used, it takes the choices but keeps more than just the values, e.g.
 
[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":4,"Value":"Has the equipment been checked due to this incident? If yes, has any action been taken because of these checks?"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":5,"Value":"What surface is the equipment sited upon and is it in good condition?"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":8,"Value":"Is this surface in a well-maintained condition?"}]
 
This in turn does not populate the values in the URL. How do I pull the values or the ID (shorter) from each chosen option and store them in a variable that can then populate a a parameter?
 
 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    Since its a multiselect column you need to make sure you are using an Array variable to receive the column. You then have two options for how to use it in the email. You can either convert the array into an HTML table or use the Join() function to convert the array into a delimited string.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    After your Get Item  for example.
    1. Add 'Parse JSON', 
    Content = body('Get_item')?['YourMultipleChoiceColumn']
    Schema:
    {
        "ID": 1,
        "Title": "TitleName",
        "YourMultipleChoiceColumn": [
            {
                "Id": 0,
                "Value": "Value0"
            },
            {
                "Id": 2,
                "Value": "Value2"
            }
        ]
    }
     
     
    2. Add 'Select'
    From :body('Parse_JSON')
    Map:
     
          id: item()?['Id'],
          value: item()?['Value']
     
     
    You have to figure out your own schema. then you will get similar like :
     
    {
      "body": [
        {
          "Id": 4,
          "Value": "Has the equipment been checked due to this incident? If yes, has any action been taken because of these checks?"
        },
        {
          "Id": 5,
          "Value": "What surface is the equipment sited upon and is it in good condition?"
        },
        {
          "Id": 8,
          "Value": "Is this surface in a well-maintained condition?"
        }
      ]
    }
     
  • Jduggins Profile Picture
    44 on at
    @Pstork1 I have managed to create an HTML table from the data:
     
     
    How do I pull the ID/Value from this table to use in a parameter? I can see outputs in a compose but I only want one of these columns, probably the ID as it is less data to store.
     
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    Instead of creating the HTML directly from the array variable use a Data Select with the Array variable as input and select just the one column that you need.  Then use the output of the data select to create the table.  If you don't see the dynamic content you need in the data select then run the variable through a Parse JSON first.  The Data Select will also let you rename the column to the header value you want.
     
    Another option would be to use the Custom setting in the Create HTML table and specify the column you need there.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Jduggins Profile Picture
    44 on at
    @Pstork1 I've obviously doe something wrong here so would appreciate a point in where to fix this:
     
    I've Initialized the Variable:
     
    I can't put the value of the column in the Value as this places it in a For Each loop which it does not like.
     
    I have then Set the value of the Variable:
     
    When I set the custom table (or the other method you suggested) I can't set the specific value I want to use. 
     
    I've not tried this before so i'm a bit lost on what to do to make this work. Any help much appreciated as i'm almost there.
  • Jduggins Profile Picture
    44 on at
    @stampcoin Thanks for your reply.
     
    I tried something like this but i'm ether formatting the JSON incorrectly (missing something out somewhere) or i'm getting an invalid JSON message. Hoping you can advise the correct structure/ I've not tried this before and i'm struggling with the correct format:
     
    This is the column in the list with some of the options (there are around 15/16)
     
     
     
    I've tried the using the Parse JSON and Select but I can't get it working. 
     
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    @Jduggins You are getting the Apply to Each Loop because there are two arrays involved.  There is the array of records from Get Items and then inside each of those records is the multiselect column, which is an array. So when you select the column to set the variable it puts it inside a loop for each record. 
     
    Then inside the loop you may or may not see the individual entries in the multiselect column. If you don't then you need a Parse JSON of that array to re-apply the schema for that specific array. That should expose the individual items in the multiselect.
     
    If your intent is to send one email for each record in the list then just process the array for the multiselect column inside the list to turn it into an HTML table and send the email.  If you want one email with all the values from all the records that gets much more involved.  To do that you'll need to have a second array variable that you append each value from the multiselect column to. That will create one array with all the values. Then when you exit the loop you can use that array to create an HTML table and send the email.
     
    This is why I usually recommend avoiding Multiselect columns entirely.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Jduggins Profile Picture
    44 on at
    @Pstork1 Thanks for this. What would be a good alternative, have a custom card on the Power App this is working with to display checkboxes for the input but then just store the results in a text field or something like that?
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    The schema should be like this, the previous one when you have the result as an example to generate the schema.
    to make it work, you have to use the choice column as the parseJSON  content.
    below one MyChoice is my multiple choice column.
     
    schema  as below.
    {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer"
          },
          "Value": {
            "type": "string"
          }
        },
        "required": [
          "Id",
          "Value"
        ]
      }
    }
    
     
    then you can add the select as I mentioned before.
     
  • Jduggins Profile Picture
    44 on at
    @stampcoin OK, so I have made some progress.
     
    Using your advice, i've scaled down the JSON and managed to start getting some success with the parsing etc.
     
     
    This is giving me the IDs of the options selected.
     
    However, I now want to use these values in a parameter in an email. The idea is they are passed to a Power App and display the relevant questions. When I try and use it, it sets the output as:
     
    [{"id":0},{"id":1},{"id":2}]
     
    If I put this into a parameter at the end of a link, in the compose it looks fine but when the email link is delivered, the parameter is cut off. Below are the parameters I have set and as you can see the Qs one is blank despite it being populated in the compose.:
     
    ID=22&screen=CCC%20Incident%20Reporting%20-%20General%20Manager%20Questions&Qs=[{
     
    <body>
    Dear ,
    We need you to answer some follow up questions. Please go to <a href="ID22&screen=CCC Incident Reporting - General Manager Questions&Qs=[{"id":0},{"id":1},{"id":2}]">Link to incident for review</a>
    <br>
    Many thanks
    Health and Safety Team
    </html>
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard