web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to determine statu...
Power Automate
Unanswered

How to determine status code for a condition

(0) ShareShare
ReportReport
Posted on by 151

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?

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,143 on at

    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

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    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,

  • PowerAppsJunkie Profile Picture
    151 on at

    @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 Profile Picture
    20 on at

    This is REALLY useful, thank you 🙂

  • Nielf Profile Picture
    306 on at

    @v-bacao-msft do you know if this has changed since you posted this? I can't get this to work using the statusCode property. 

  • JasonZF Profile Picture
    572 on at

    Worked great for me. In my case, I am reading the output of an 'Add member to group' action using

     

    outputs('Add_member_to_group')['statusCode']

     

    My only problem now is how to get a list of status codes. Is it action-specific?

     

    JasonWS_0-1649763435713.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard