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?
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?
@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.
This is REALLY useful, thank you 🙂
@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?
Hi @PowerAppsJunkie ,
You could try the following method to get the status code.
outputs('ActionName')['statusCode']
Image reference:
Hope it helps.
Best Regards,
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
WarrenBelz
146,763
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional