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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multi select/choices f...
Power Apps
Answered

Multi select/choices field populated via power automate

(0) ShareShare
ReportReport
Posted on by 196

Hi All,

 

I've been looking for a solution for this issue and can't seem to find one. I'm using power automate to create a new record in my dataverse when a Form submission is received. Part of the form is a multiselect box where the user can choose the areas the supplier will work with. I need this to then populate the Multiselect/Choices field my dataverse table to use within a model driven app. 

 

I know that choice fields use a value when assigning using Power Automate. But I can't figure out how to reference each field get the correct value and then add that to a string that will then created the record. Is there a way to reference the choices column list out all the choices match them and then get the values? I've tried building it in Power Automate and creating an array with all the choices and values but when it tries to select it just returns all values in the array. 

 

Is there a better way to do this? 

I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @mousman85,

     

    You can retrieve the labels/values for a Choices field by querying the StringMap table. This video goes through a step by step of how you can accomplish this. In your case you have the label and want to get the value, which is the opposite in the video so you'll have to slightly tweak your FetchXml query but the overall approach should be similar. You can join the array output of the query into a comma separated string which can be passed into your Choices column when creating your Dataverse record.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

  • mousman85 Profile Picture
    196 on at

    Thanks for the reply Chris. That video was super useful. I acutaly worked a different way to at least get the values. I'm using the List Rows connector in Power Automate on the String Maps table, and have applied an ODATA filter to filter it for the attributename to eq my choices field, and then I've added a second filter that filters the values by the Type i want to match. This is now returning the values correctly the only but I can't figure out is how to then append each value in a comma spaced string so 00001, 00002, 00003, etc I've tried adding an append to string at the end of the apply to each section using Current Item, but this just set the variable each time to a single result. image.pngimage.png

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @mousman85,

     

    You can use the Join expression to turn the array into a comma separated string.

    e.g. join([<multiselectoutput>], ',')

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • mousman85 Profile Picture
    196 on at

    Thanks does this work on an append to string? The issue I was seeing is that each apply to each is only returning a single value, so I need to take that value store it or keep appending each returned value to create a string. 

  • Verified answer
    ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @mousman85,

     

    You can skip the apply to each and append step. You instead can just assign the variable using the Join expression as mentioned.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • mousman85 Profile Picture
    196 on at

    I don't think this will work as I don't have an array, the List rows action, is returning individual values that match the filters so if it matches the Option - Project Manager it returns a single value of 0000001, I need to join these matched values together to form a string of each returned matched value. Which could be 0000001 , 00000012 , 0000003 etc. I can get each value returned individually but can't work out how to then keep adding to the first value found. 

  • mousman85 Profile Picture
    196 on at

    I managed to solve this in the end I didn't realise that you needed to get the append to array variable output after you've done all the appends,  Thanks @ChrisPiasecki for your replies it guided me into the right place!

     

     

  • takolota1 Profile Picture
    4,974 Moderator on at

    @mousman85 & @ChrisPiasecki 

    This is all for entering values into a multi-select field for a Dataverse Update action?

     

    I have to enter possible multiple choice meal time options in to my Dataverse table and I just use the following expression to create my string of numbers matching the choices:

    replace(trim(concat(if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Breakfast'),'759090000 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Lunch'),'759090001 ',''), if(contains(triggerOutputs()?['body/28 - Service Times Offered'],'Dinner'),'759090002 ',''))), ' '',')
     
    The field is mandatory so I don't have to worry about null values in a replace function, but even if it wasn't mandatory I would just use a if(empty(InsertOutput), '', Replace(InsertOtherFunctions)) to avoid the null values in replace function issues.
     
    All the integer values are available if you go to the table, go to edit choices, click the three dots ... and select view more.
    find int2.pngFind int1.png
  • WendyLumsden Profile Picture
    56 on at

    @mousman85 , @ChrisPiasecki , @takolota .... another helpful resources was this one:  https://powerusers.microsoft.com/t5/Building-Flows/Power-automate-to-Copy-SharePoint-Multi-Choice-values-to/m-p/1858866
    I was battling to convert the strings (created by replace) to integers which Dataverse required and since I had over 10 multichoice fields all the replace() and int()'s got very confusing :).  This was a simpler solution.

  • WendyLumsden Profile Picture
    56 on at

    Hi @mousman85 , @takolota , @ChrisPiasecki 

     

    Did any of you receive an error message when trying to update the CDS/Dataverse multi select field with multiple values?  I keep getting an error message that the values I am providing are not valid integers.

     

    To prevent the error message, I then created an array of valid integers:

    This I created by using replace() to replace the labels of the user selected input from MSForm, with the corresponding multi select code (numeric) values.  After using replace() to remove all the quotes and square brackets, I split the resultant output into an array of numeric codes.  I then used int() to append to a second array - thus ensuring that the second array is one of only valid integers.  No error messages so all looking good and the output from a test run looks clean too.


    Now I have to convert this array of integers into something that Dataverse will accept for the multi select field.   Have tried updating the multi select field with output from two compose functions using the integer array:

    1.  join(integer array,',') and
    2. concat(integer array)

    Neither of these result in output which Dataverse will accept.  Here is the error message: 
             "The optionset values sent [948170000,948170001,948170002,948170003,948170004,948170005,948170006,948170008,948170010] are not valid integers."

     

    Any ideas?  Can't find any solutions which work on any platforms.  

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard