Exception

All containers on the flow will be used to catch error messages using the result() expression.

result('container_name')

A container is an action that contains other actions:

  • Scope

  • Condition

  • Switch

  • Apply to Each

  • Do Until

How to use - Standard use

To create the exception expression click on the Power DevBox Exception

A popup will show when complete, listing all the containers included in the exception message.

The exception expression is then added to your computers clipboard ready to be pasted (Ctrl + V) where required.

As an example, from the above image the below expression is created.

@{xpath(
  xml(
    json(
      concat(
        '{"data": {'
      ,
        '"Main":'
      ,
        result('Main')
      ,
        ','
      ,
        '"Condition_api":'
      ,
        result('Condition_api')
      ,
        ','
      ,
        '}}'
      )
    )
  )
,
  'string(//message[not(contains(.,''The execution of template action'')) and not(contains(.,''skipped:'')) and not(contains(.,''An action failed. No dependent actions succeeded.''))])'
)}

Once pasted in an action is should appear as below.

Additional Information

  • The flow must be saved/published before use

  • Containers with the word 'Exception' in the title are skipped, this is to avoid self referencing errors

  • If the expression is not show, open expression editor, paste in and then remove leading @{ and trailing }

  • Power DevBox Exception is used within the Power Automate maker studio (currently does not support Power Apps maker studio

  • Certain nested containers can cause issues when saving, as Power Automate will not allow it. To rectify either remove the action from the expression, or temporally rename the container to "Exception", re-run Power DevBox Exception, paste in the expression, then change the name back

How to use - Extended Capability

Select actions do not pass error messages to the container (example Dataverse actions). This requires the action to be referenced directly with both actions() and outputs() expression.

actions('action_name')
outputs('action_name')

To add actions directly click the Exception icon shown in the Power Automate tope menu bar.

A popup menu will now appear (this can be dragged to where needed). Double clicking on actions will add them to the popup (clicking on the list will remove them) .

Your clipboard will be updated with the new expression ready to be pasted.

To hide the popup and deactivate the double click functionality click on the top menu Icon again.

As an example, from the above image the below expression is created.

@{xpath(
    xml(
        json(
            concat(
                '{"data": {'
            ,
                '"Main":'
            ,
                result('Main')
            ,
                ','
            ,
                '"Condition_api":'
            ,
                result('Condition_api')
            ,
                ','
            ,
                '"Files":'
            ,
                actions('Files')
            ,
                ','
            ,
                '"Files-O":'
            ,
                outputs('Files')
            ,
                ','
            ,
                '"Compose":'
            ,
                actions('Compose')
            ,
                ','
            ,
                '"Compose-O":'
            ,
                outputs('Compose')
            ,
                ','
            ,
                '}}'
            )
        )
    )
,
    'string(//message[not(contains(.,''The execution of template action'')) and not(contains(.,''skipped:''))  and not(contains(.,''An action failed. No dependent actions succeeded.''))])'
)}

Last updated