Multiple Queries can be triggered in serial/parallel/conditional when a user interacts with a widget
This document presumes you are familiar with triggering actions from widgets and expands on triggering more complex actions to create a workflow.
Handling Success / Error
The property pane allows us to configure the action to take once a Query returns with a success or an error. Success / Error is determined by the HTTP status code or the query response status returned by the API / Query.
We can decide to display a success or an error message by using the showAlert Action.
Executing Queries in Parallel / Serial
Every query object contains a run method that is used to execute it. The run method is asynchronous and multiple queries can be executed in parallel as below
or chained to be called onSuccess / onError using the callback arguments in the Run Signature
.catch(()=>showAlert("Fetch Users Failed"))
).catch(()=>showAlert("Update User Failed","error"))
Queries can also be chained to execute conditionally based on the value of a widget or the response of a Query