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

How to determine status code for a condition

I want to put in a condition that checks the output status code of the step above it.


So if it's output status code is 200 it's yes but if it's output status code is 404 then it's no.

What would be the syntax to have a condition step read the "Status Code" of a prior step and take action based on this?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to determine status code for a condition

 

Hi @PowerAppsJunkie ,

 

You could try the following method to get the status code.

  • Configure Compose action under the specified action to get the status code.
outputs('ActionName')['statusCode']
  • If the action name contains a space, replace the space with "_".
  • Set Configure run after, continue to execute the following action when the above action runs successfully and fails.

Image reference:

132.PNG

133.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: How to determine status code for a condition

Hi @PowerAppsJunkie 

 

So lets say you have an http request action and you need to fetch the response status code

 

you can use expression

body('HTTP')?['statusCode']

 

You can share screenshot of your action which produces the status code response if you want the exact expression

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Community Support Team
Community Support Team

Re: How to determine status code for a condition

 

Hi @PowerAppsJunkie ,

 

You could try the following method to get the status code.

  • Configure Compose action under the specified action to get the status code.
outputs('ActionName')['statusCode']
  • If the action name contains a space, replace the space with "_".
  • Set Configure run after, continue to execute the following action when the above action runs successfully and fails.

Image reference:

132.PNG

133.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

PowerAppsJunkie
Level: Powered On

Re: How to determine status code for a condition

@v-bacao-msft That worked great!

I have a question though.  Is there a reason to use it in compose vs just putting that statement in the expression of the condition?

 

I used it both the compose and the condition and it worked both ways.

 

Also if I wanted to check the output of say Body instead of statusCode would I use ['Body']?  Is there a reference for outputs that I can lookup so I know what I can grab from the output of an action?

jimbul
Level: Powered On

Re: How to determine status code for a condition

This is REALLY useful, thank you 🙂

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,206)