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

Forms to Sharepoint Multi Choice Field

We have a Forms input:

 

https://i.imgur.com/GiyO3ZN.png

 

Using Flow to move the Forms data to Sharepoint Multi Choice field in List

https://i.imgur.com/pmMKJuX.png

 

Same issue but hoping there are better ways of doing it now:

https://powerusers.microsoft.com/t5/Building-Flows/Converting-multi-choice-form-item-into-multi-choi...

 

1 REPLY 1
manuelstgomes
Super User II
Super User II

Hi @robcarrs 

 

The issue is that you're passing to SharePoint a "string" that comes from the Form that contains a JSON with an array. Quite tricky, I know, but let's break it down into an example:

 

The "Create Item" expects something like this:

 

[
  {
    "Value": "Option 1"
  },
  {
    "Value": "Option 3"
  }
]

 

and you're providing

[
{
"Value":"[\"Option 1\",\"Option 3\"]"
}
]

You need to convert it to an array of values so that SharePoint can match the items and know what to do with them.

 

You need to:

  1.  Remove the special characters [," and ]
  2. Create an array
  3. Build a new array with the structure {"Value":"Option 1"}

 

Here's the full flow:

2020-02-07 15_17_53-Edit your flow _ Power Automate.png

 

To remove the characters, use a compose with the following formula:

 

replace(replace(replace(body('Get_response_details')?['re96ff20a4f3d44ec9485b8250dbbc748'],']',''),'[',''),'"','')

 

Then create an array with the elements:

split(outputs('Removes_the_Characters'),',')

 

To create the array create an empty array variable. Then do a for each and append to the array with the following formula:

json(concat('{"Value":"',items('Apply_To_Each'),'"}'))

Finally, insert the value in the "Create Item."

 

You'll get something like this:

2020-02-07 15_15_09-Run History _ Power Automate.png2020-02-07 15_15_15-Run History _ Power Automate.png2020-02-07 15_15_29-Run History _ Power Automate.png2020-02-07 15_15_40-Run History _ Power Automate.png

 

I've added a template so that you can import so that you don't need to create everything manually. 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (63,550)