Skip to main content

Search

Debugging background actions

Comments

1 comment

  • Christof

    Hi Dieter,

    Yes, Debug Mode is only available for client-side action execution, where the debug information is written to the browser console.

    For Background Actions, debugging works a bit differently. Here are a few tips that can help during development and with error handling:

    • Use the Scope control to implement proper error handling. This is useful not only during development, but also for handling errors when the Background Action runs in production.
    • Make use of the Action Outputs of the Scope action. They can provide useful information about the execution and the results of the actions within the Scope.
    • Keep in mind that you need to know the type and structure of the returned data when inspecting or logging outputs. For example, if an action returns a JSON object, you can stringify it before logging or storing it:
    • If you need more detailed diagnostics, you can implement your own logging. For example, store log information in a SharePoint item, send it by email, or, as you're already doing today, write it to a file.
    • When working with the Send HTTP Request action, use the Test button during development. This allows you to inspect the response returned by the API without having to run the complete Background Action.
    • And, of course, check the History of the Background Action. Especially for failed runs, the error message can already give you a good indication of what went wrong.

    So, while there is no equivalent interactive Debug Mode for Background Actions, the combination of Test, Scope/Action Outputs, History, and custom logging usually provides the information needed to troubleshoot them.

    Hope this helps!

    0

Please sign in to leave a comment.