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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error Handling using t...
Power Automate
Answered

Error Handling using the actions method

(0) ShareShare
ReportReport
Posted on by 32

In my flow I am trying to capture an error message and status of the previous action if it fails. This is how my flow looks like:

dbgghost_0-1711554949274.png

In my compose I have these two functions:

actions('Create_BoA_File_in_fs20_fileshare')?['body']?['status'] 
actions('Create_BoA_File_in_fs20_fileshare')?['body']?['error']?['message']
 
Here is the output from the create a file action after it fails:
"body": {
        "status": 404,
        "message": "Could not connect to your data gateway. Make sure your file system is active with the gateway running. The detailed error is 'Gateway on endpoint is unreachable.',
        "error": {
            "message": "Could not connect to your data gateway. Make sure your file system is active with the gateway running."
        },
        "source": "filesystem"
    }
}
 
When I test the flow, both functions return nothing. What am I doing wrong?
Categories:
  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @dbgghost 

     

    This should be correct expressions 

     

    outputs('Create_BoA_File_in_fs20_fileshare')?['body']?['status'] 

    outputs('Create_BoA_File_in_fs20_fileshare')?['body']?['error']?['message']

     

    Or 

    Another approach is to access the body directly 

     

    body('Create_BoA_File_in_fs20_fileshare')?['status']

    body('Create_BoA_File_in_fs20_fileshare')?['error']?['message']

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @dbgghost 

     

    I don't know there was actions function in power automate, did a little research and got to learn something new !

     

    Well your current expression with actions needs a little change !

    see below 

     

    actions('Create_BoA_File_in_fs20_fileshare')?['outputs']?['body']?['status'] 
    actions('Create_BoA_File_in_fs20_fileshare')?['outputs']?['body']?['error']?['message']
     
    You can try my earlier expressions as well which i have shared in my previous reply 🙂
     
    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • dbgghost Profile Picture
    32 on at

    Thank you, both of those solutions worked for me!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard