cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

How to Handle Error Code with condition

So, I have part of my flow below.

 

My Get Work Item Details runs and grabs some data for me based off cells in a spreadsheet.

The one thing I CANT make dynamic is the "Work Item Type" field.

 

Most of these are of type "Issue"....but for example, one might flow through where it is a "Feature".

Obviously, this will cause the get work item to fail.

 

It does give me an output, with a status code of 400.

 

Here is how I am wanting this to flow, but dont know how to do it.

 

1.  Get Work Items runs

2.  A condition checks if the output is status code 400 or not.

     A.   If it is NOT 400 (meaning it was successful), it can go through the parse JSON and update excel

     B.  If it does fail and passes the 400, then I want to pump the data through another get work item but with work type set differently.

 

I have tried a few ways to setup the condition with the error code.  But it never works.

The only dynamic values I have for Get Work Item is URL, Body, ID.

I tried it with body, but never got it to work.

 

I am trying to figure out a way for all of this to run, and each time it fails it moves onto a different try with different parameters till it succeeds, thus causing my flow not to show failed.

 

Flow4.JPG

 

EDIT:  I just want to add, since I could not get the condition to work with the status code, I tried doing a parallel branch, where I set the configure to run on one side as success, and then the other side to run when there was a failure.  That was working, but I kept breaking down into deeper branches, and even though it would eventually run, the flow shows failed.

There has to be an easier way to do this.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: How to Handle Error Code with condition

@lardo5150 

Hi there.  Here's an article where I did something similar, Using "Run After" as a Condition in Power Automate / Flow.  It might be enough to get you started.

 

Either way, keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: How to Handle Error Code with condition

@lardo5150 

Hi there.  Here's an article where I did something similar, Using "Run After" as a Condition in Power Automate / Flow.  It might be enough to get you started.

 

Either way, keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: How to Handle Error Code with condition

This worked!

 

I used the scope actions.  THANK YOU!

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,663)