Choice Column in SharePoint not Populating Correctly from Forms?

Copper Contributor

Hi everyone,

 

Reaching out today as I am running into a new issue that did not used to exist. 

I have a MS Form which after completed triggers a Flow that stores the data in a SP List.

The problem I am receiving is for the Choice/ Option Select columns the data is coming in as what appears to be a string, instead of matching one choice with its corresponding value. 

All values match equally between Forms and SP and this flow used to work as intended before I took it over and needed to make updates, which nothing major changed that would cause this to break. Now these values are not populating correctly and it is causing a headache. 

Any advice would be welcome.

 

Current Functionality

andymx_0-1706644828903.png

Past Functionality

andymx_1-1706644935084.png

 

Flow Logic

andymx_2-1706645028900.png

 

Thanks,

Max

4 Replies

Did you check to make sure there are no errant hidden characters? I just ran a quick check and seems to be working correctly on my end. Was anything changed on the SP choice column side?

 

Is it a multi-choice selection?

tmayrand_7-1706649564374.png

 

I convert the string to a json object (will result in an array) so that it can be consumed by the Select operation, which will remap from a simple array to an array of objects.

 

Make sure to think about error handling in the following cases:

- If the selection is optional, the Select operation will fail.

- SP list expects a value from the choice list and none or one not in the list was provided.

 

This thread also provides another approach: Solved: SharePoint Choice Field [ARRAY] Requires "Apply to... - Power Platform Community (microsoft....

How can I convert the string to a json? I dont remember ever needing to do this step to match option select with other option selects between Forms and SP. The only thing that was changed on the SP choice column side was updating it to add new values as to match with the Form 1 to 1

@andymx it looks to me that you might have changed the question in Forms to allow multiple selections rather than just 1 selection.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

@andymx, your SP List choice column may have been changed from single selection to multi-selection. This is the only thing that I think could explain the change. If the choice field is multi-selection, then an object must be passed to set its value(s).

 

That or @Rob_Elliott's hypothesis.

 

To answer how to convert your form multi-choice input string to an object...

 

The mluti-value choice from Forms produces a string resembling:

 

"[\"choice 1\", "\choice 4\"]"

 

 

The following json instruction (in the Select operation):

json(outputs('Get_response_details')?['body/<choice_attribute_id_or_path+name>'])

converts the Forms string to a JSON array as follows:

[
  "choice 1",
  "choice 4"
]

 

The Select operation allows you to remap this array of strings to an array of objects (format consumable by the Sharepoint Create/Update Item connector:

[
  { "Value": "choice 1" },
  { "Value": "choice 4" }
]