cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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

7 REPLIES 7
Highlighted
Super User II
Super User II

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

Highlighted
Super User III
Super User III

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

Highlighted
Super User III
Super User III

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

Highlighted

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

Highlighted

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

Highlighted

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

Highlighted

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (11,706)