Jan 30 2024 12:04 PM
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
Past Functionality
Flow Logic
Thanks,
Max
Jan 30 2024 12:32 PM - edited Jan 30 2024 01:22 PM
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?
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....
Jan 31 2024 08:15 AM
Jan 31 2024 08:35 AM
@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)
Jan 31 2024 10:23 AM - edited Jan 31 2024 10:38 AM
@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" }
]