Debugging background actions
Hello everyone
I am currently working on a huge skybow solution with two background actions that interface an API.
It seems sometimes very difficult to debug such background actions. Using the Debug-Mode does not help in this situation.
Does anyone has a good idea or debug-strategy to do this? Currently i try to use the "store file" action to store action outputs or object/values. However, in a large action set, this gets quite complicated to handle and it needs individual treatment for the outputs to be in clear text without an object reference.
Any ideas on this?
Best wishes
Dieter
-
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 - 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.
Please sign in to leave a comment.
Comments
1 comment