cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
geophman
Regular Visitor

Case Switch from an MS form not working

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?Flows failure.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

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 questionMultiple 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 JSONParse 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 variableAppend 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 CaseSwitch 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.

4-Result.png

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.

 

View solution in original post

8 REPLIES 8
Gristy
Resident Rockstar
Resident Rockstar

Looks like the answer is AEDs and your looking for AED/PAD

RobElliott
Super User
Super User

@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.

RobElliott
Super User
Super User

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 questionMultiple 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 JSONParse 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 variableAppend 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 CaseSwitch 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.

4-Result.png

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.

 

View solution in original post

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

Flow fail.jpg

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.

Flow fail.2.jpg

 
shisey1
Frequent Visitor

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?

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

Top Solution Authors
Top Kudoed Authors
Users online (39,272)