From 9d62a552feea09cda5d970517b43aae700deb5a6 Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Tue, 8 Nov 2022 23:18:21 +0100 Subject: [PATCH] docs: Add explanation of setActionItem usage --- packages/docs/pages/build-integrations/actions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/docs/pages/build-integrations/actions.md b/packages/docs/pages/build-integrations/actions.md index 2895ff63..aac06cee 100644 --- a/packages/docs/pages/build-integrations/actions.md +++ b/packages/docs/pages/build-integrations/actions.md @@ -115,6 +115,10 @@ export default defineAction({ }); ``` +In this action, we send a request to the cat API to mark the cat image as favorite. We used the `$.http.post` method to send the request. The request body contains the image ID as it's required by the API. + +`$.setActionItem` is used to set the result of the action, so we set the response data as the action item. This is used to display the result of the action in the Automatisch UI and can be used in the next steps of the workflow. + ## Test the action Let's go to the flows page of Automatisch and create a new flow. Add the `Search cat images` as a trigger in the flow. Add the `Mark the cat image as favorite` action to the flow as a second step. Add one of the image IDs you got from the cat API as `Image ID` argument to the action. Click `Test & Continue` button. If you a see JSON response in the user interface, it means that both the trigger and the action we built are working properly.