Help with adding Power Automate Error Handling to my flows.

Options

@Alex Wong

Thank you so much for the #bbdevdays recording on how to improve the management of Power Automate error handling. I am working on setting up one flow to use as a template as you suggested and I'm having issues with the link not working correctly. I am optimistic you can tell me what I missed in my expression.

Here is a image of the error I get when I click the link in my Teams post:

88e796cd0ecd635338e22fb566221c1e-huge-im

Here is a snapshot of my html code that I used in the flow:

6b9b5d3d02f44fbf2e7c13386baad1b7-huge-im

I would appreciate your guidance on how I can get this link to work. This is such a value add to the process!

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Hallie Guiseppe
    with just the screenshot, very hard to tell what you did wrong. I imagine you used the wrong “name” dynamic content.

    Here's what it should be:

    Assuming your Parse JSON for the workflow expression is named: Parse JSON Current Running Work Flow

    https://make.powerautomate.com/environments/@{body('Parse_JSON_Current_Running_Work_Flow')?['tags']?['environmentName']}/flows/@{body('Parse_JSON_Current_Running_Work_Flow')?['name']}/runs/@{body('Parse_JSON_Current_Running_Work_Flow')?['run']?['name']}

  • @Alex Wong
    Hi Alex,

    I copied the code into a text editor, and the following is what I have in the embedded in the post:

    ---------------------

    Power Automate workflow @{body('Parse_JSON_Current_Running_Work_Flow')?['content']?['tags']?['flowDisplayName']} failed to complete its scheduled run.
    <p><a href="https://make.powerautomate.com/environments/@{body('Parse_JSON_Current_Running_Work_Flow')?['content']?['tags']?['environmentName']}/flows/@{body('Parse_JSON_Current_Running_Work_Flow')?['content']?['name']}/runs/@{body('Parse_JSON_Current_Running_Work_Flow')?['content']?['run']?['name']}">View the Failed Flow Run</a></p>

    ------------------------

    For some reason, the link comes out without any information from the variable fields. Here is the link that is being posted in Teams:

    The Parse JSON Body has the information as you can see in the snip below, and I confirmed that the information matches the flow I'm working in.

    be17342a19dda0b8090f2022925dc3e2-huge-im
    Parse JSON Output

    Do you have any idea why it isn't outputting any information into the string? I tried using a compose action to just pull in the individual fields but they return blank too.

    0f102ed83e7c82ac4fc1f9ec85a707d1-huge-im
    Compose item return no information

    I'm stumped and not sure where to go from here. ?

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Hallie Guiseppe
    You are not pulling the right dynamic content.

    Your environmentName dynamic content is:

    @{body('Parse_JSON_Current_Running_Work_Flow')?['content']?['tags']?['environmentName']}

    However, it should be:

    @{body('Parse_JSON_Current_Running_Work_Flow')?['tags']?['environmentName']}

    You are somehow telling power automate that the data you want to use is inside a “content” object of JSON, and then within it find “tags" and then find “environmentName”. Where in reality “content” is not a property.

    The easiest thing to do is to “delete” the dynamic content, and select it from the dynamic content area. However, b/c there is 1 property that is the same name, it is hard to know which one you want to take and put it where on the URL. So here's something you can do:

    Go to your Parse JSON Current Running Work Flow action, and in the Schema, put this in:

    {"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"base name"},"type":{"type":"string"},"location":{"type":"string"},"tags":{"type":"object","properties":{"flowDisplayName":{"type":"string"},"environmentName":{"type":"string"},"logicAppName":{"type":"string"},"environmentFlowSuspensionReason":{"type":"string"}}},"run":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"name inside run"},"type":{"type":"string"}}}}}

    The different is in the “red”, where I put “base name” as the description for the property of “name” in the base of the JSON object, and “name inside run” as description for the property of “name” inside the “run” object.

    “x” out each of the dynamic content used in your send team message action and select from the dynamci content box the needed values.

    a43632205e752692b25cecbe9b02098d-huge-im

    Note the “name” property with the description of “base name” goes before /runs/

    and

    “name" property with the description of ”name inside run" goes after /runs/

  • @Alex Wong
    Thank you! I finally got it to work! Now I just to embed it in all my existing flows! As per usual, Alex to the rescue!

    Have a wonderful Thanksgiving, my friend!

    ???

Categories