Forum Discussion
Forms Pro to Power Automate for multiple answers
Hi Justin ( Moodycrmguy) as it's a Forms question that allows multiple answers we need to split out each answer and add it into a string variable. In my example below the user can select 1 or more sessions to attend and we're then creating a Planner task.
After the When a new response is submitted trigger and Get response details action we need to add an Initialize string variable which I've called varSession.
The next action is a Parse JSON action and the syntax you need to add is
{
"type": "array",
"items": {
"type": "string"
}
}
Next add an Apply to each control and select Body from the dynamic content. Inside the Apply to each add an Append to string variable, select the name and for the value select Item from the dynamic content.
The next action is to add the Switch control and select the string variable from the dynamic content.
In each switch case I've then added the Planner Create a task action but your flow will have a different action. However you do need to reset the variable back to null before the next multi-choice answer is looked at, so add a Set variable, select it and in the value field add the expression null.
In my form I selected both SharePoint and Power Automate as the sessions to attend and this is the result of the SharePoint answer. The Power Automate answer went down its switch case channel correctly as well.
Hope that helps.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Hi Rob, thank you so much for this very useful - I have followed your steps and using the following Question answers:
However it still does not trigger any outcomes and it seems to connect the two answers together?
Thanks
Justin