I have a flow built to create task in Planner and assign it to a specific person based on an answer to a question on an MS Form. I'm using a Case Switch, but it's not matching the text string from the Form to the text on the case. What am I missing?
Solved! Go to Solution.
Hi @geophman 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:
Multiple answers to question
So 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"
}
}
Parse JSON
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.
Append to string variable
In each switch case you then add the Planner Create a task action. But then you 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.
Switch Case
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.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Looks like the answer is AEDs and your looking for AED/PAD
@Gristy no it's not that, the switch case has just been renamed to AED/PAD.
@geophman [Edited response] it's because your question in Forms is multi-select. I'll post a solution for you shortly.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi @geophman 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:
Multiple answers to question
So 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"
}
}
Parse JSON
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.
Append to string variable
In each switch case you then add the Planner Create a task action. But then you 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.
Switch Case
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.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
So I think I got it. I added the actions you suggested and tested and it failed. I've attached a pic. I'm not sure what I missed.
-Geoff
Could you post a screenshot of the flow steps from your Parse JSON to the Switch please. The result of your switch is showing ["AEDS"] whereas mine was SharePoint without the bracket and quotation marks so something is not quite right.
Rob
Los Gallardos
Thanks Rob! I didn't know if that was ignored formatting, now it seems that it isn't. Here's the other part of the flow.
This so helpful @RobElliott , thank you! I have a multi answer Forms that I want to parse out each selected answer and document it in the corresponding column in Excel. I'm soooo close with this. However, it don't put in the answers in the columns and I'm not sure what I'm missing. The flow runs, but on the cases, it says " ActionBranchingConditionNotSatisfied. The execution of template action 'Update a Row' skipped as the branching condition for this action was not satisfied. Any ideas?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
140 | |
42 | |
42 | |
35 | |
30 |