cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daniellemaree
Level: Powered On

Switch Cases & Error Handling

I have a switch based on a user's department, based on the department the user will be added to the O365 group. 

 

However I have realised when the user already exsits in the group the flow errors. So i tried to create an error handling "configure on run after" however in the switch case this option is greyed out. "Cannot configure run after on the first action in a scope."

 

Is there any solution how error handling can be prevented in switch cases? There will be up to 34 different departments the switch case will be using

 

As if i dont set this my flow will fail and im trying to prevent that from happening.

 

 

errorhandle.PNG

 

 

4 REPLIES 4
Highlighted
Community Support Team
Community Support Team

Re: Switch Cases & Error Handling

Hi @daniellemaree,

 

Do you want to prevent the error message from occurring when the user already exists in the group?

Before adding the user into the group, please add a condition to check whether the user exists or not. If already exists, do nothing. If not, add the user into the group.

I have made the following test.

Add the trigger When a new email arrives.

Add the action Initialize variable. Set Name as Name, Type as Array.

Add Switch cases on Subject.

Within Case1, add action List group members.

Add an Apply to each, select Value from previous action List group members. Value set as dynamic content Mail.

Add a Condition, if variables Name contains From (dynamic content from the trigger), do nothing. If no, add member to group.

The same configuration for other cases.

Images for your reference.

1.PNG2.PNG

Besides, if you want to configure run after within the case, please add a dumb action before the action which you want to configure run after. Such as a Compose action.

Please take a try with it on your side.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
daniellemaree
Level: Powered On

Re: Switch Cases & Error Handling

Hi @v-yamao-msft

 

Can this example be done without the email arrival? 

 

As they will be using a powerapp to submit the request. From there the flow is running based on when an item is submitted into the SP list. 

 

Is it possible to check if a user is in the group first before? Once the item powerapp is submited from the user this will be stored in a SP list. Is it possible  to see if a user is in 0365 group first?

 

 

 

 

 

Community Support Team
Community Support Team

Re: Switch Cases & Error Handling

Hi @daniellemaree,

 

Yes, you could change the trigger to others based on your scenario. I assume that the SharePoint trigger When an item is created would be appropriate for your scenario.

It seems that users would submit data from PowerApps to SharePoint. To see if a user in Office 365 Group first, you may need to create another flow with the PowerApps button trigger to check if the submitted user exists in the group or not. If already exists, do nothing, if not, add the item to SharePoint list.

Hope it could be your reference.

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
daniellemaree
Level: Powered On

Re: Switch Cases & Error Handling

Hi @v-yamao-msft

 

how do you check if the submitted user exists in the group or not? 

 

thanks 

 

danielle

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 183 members 4,567 guests
Please welcome our newest community members: