Make sure your flows can handle when things don’t go as expected: Error Handling and write a Log.

Learning Objectives

  • Error Handling
  • Write a log
  • JSON Parsing


  • Create two number variables, A and B
  • Compose
    • Add the two variables to each other
      • Expression: add(variables(‘A’),variables(‘B’))
  • What happens if you change B to a text?
    • Error we need to handle
  • Use the Configure run after setting and create the rest of the flow, that
    • Write a log with the status and an error message, if it appears
    • In case of an error send an email with
      • The flow name
      • Time of the flow run
      • The status
      • The error message
      • The link to the flow
    • Set the status of the flow to Failed
  • Create a Scope with three Scopes in
    • Try Catch
      • Try
      • Catch
      • Finally
    • Let it handle exceptions in our flow
      • “Configure run after” in the following action
  • Advanced


Code (expression) to get the link (URL) to a Microsoft Power Automate flow: