cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate III
Advocate III

When a "failure" is actually a success in the end

Greetings!!!

 

I got a flow that gets items from a Sharepoint list.

  1. It looks at the person field 
  2. using that person's email it queries o365 users
  3. End of story

Scenario A

If the user is valid

  1. sharepoint list is updated to reflect - yes this is an active user
  2. end of story

 

Scenario B

If the user is not valid or not found in o365 users, its considered a failure

  1. in a failure we move to another branch set to run only after previous failure
  2. Sharepoint list is updated to reflect - No this is Not active user
  3. End of story

 

My flow runs, it runs well and all updates are properly handled.

The hang up is that if our story ends via Scenario B, its considered a wholesale failure.

Looking at my flow history, = its a failure

 

How can I massage the flow to treat scenario B to also be a success?

1 ACCEPTED SOLUTION

Accepted Solutions
Resident Rockstar
Resident Rockstar

Hi @chico 

It would be useful to see a picture of your complete Flow on this one, but if I am understanding correctly, the best way to mark a failure as a success, i.e, the fail is by design is to use a terminate action and mark it as "succeeded". If this suits your Flow design that is.

Capture-505.png

This may or may not fit your design though, please post your Flow and we will see.

 

If you have found my post helpful, please mark thumbs up.

 

Any other questions, just ask.

 

Thanks, Alan

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

4 REPLIES 4
Resident Rockstar
Resident Rockstar

Hi @chico 

It would be useful to see a picture of your complete Flow on this one, but if I am understanding correctly, the best way to mark a failure as a success, i.e, the fail is by design is to use a terminate action and mark it as "succeeded". If this suits your Flow design that is.

Capture-505.png

This may or may not fit your design though, please post your Flow and we will see.

 

If you have found my post helpful, please mark thumbs up.

 

Any other questions, just ask.

 

Thanks, Alan

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

Hi @chico you could always change the "run after" settings so that you can gracefully catch the error. You can do this by clicking on the ellipsis for the step following the failing action and set it to run on Error. This usually works better if you contain all of your logic in scopes. Whilst this will work, the inner developer in me is screaming no 🙂

 

What I would suggest for a cleaner approach would be to use "Search for Users" and search for the email address. If the length of the body returned is 0, then the user doesn't exist. If it's greater than 0, then you have a match.

 

Search.PNG

 

The expression I have used in the condition is:

length(body('Search_for_users'))
 
This will at least give you a True/False test which will mean your Flow is a lot cleaner than if you're relying on an error state.
 
If you have found this post useful, please give it a thumbs up. If it has answered your question, please accept it as the solution so others can benefit.

@MattWeston365
 




Did my reply help? Please give it a thumbs up.
Did I answer your question? Please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up. THANKS!


Proud to be a Flownaut!





Community Leader: Black Country PowerApps & Flow User Group

@AlanPs1 

awesome input, thank you!

will be exploring this today!

@MattWeston365 

 

awesome input, thank you!

will be exploring this today!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (61,309)