The Send Data action allows the use of POST, PUT, and PATCH requests to an API in your workflows. This article discusses the Send Data action in more detail.
Table of Contents
Understanding the Send Data Action
POST, PUT, and PATCH requests allow information to be sent and posted to or put on resources on the web, effectively changing the state of these resources. PUT is used to update all the fields in a record, POST is generally only for new records, and PATCH is for partial updates to a resource.
The Send Data action allows a POST, PUT, and/or PATCH request to be used with your workflows. The API requests must have been set up previously in the API Manager, which is accessible from the Main Menu. For more information, see Using the AUTTO API Manager.
NOTE: The Send Data Action is disabled if a GET request has not been set up in the AUTTO API Manager.
With the Send Data action, you select the square brackets for the parameters that are sent with an API POST/PUT/PATCH request and the square brackets for the data sent to an external system. You may also need to define the square brackets that will receive the data from the external system. You can then use the received square brackets in your workflow.
If you enable the Run for Table option for the Send Data action, you will also need to specify an input table that serves as the base version of an output table. The parameters that are sent with the API POST/PUT/PATCH request can come from the input table. The API response/s sent back to the workflow is/are entered into the output table. For more information on the Run for Table option, see Getting Started with Run for Table.
The Send Data action works with both persistent data tables created under the Main Menu and temporary tables created earlier in a workflow.
Setting Up a Send Data Action
Use a Send Data action anytime you need to post/put information into a web resource that is made available via an API.
To set up a Send Data action:
- Drag a Send Data action to the canvas of the Workflow Editor, then connect it to the previous action in the workflow.
- Position your cursor over the action, then click the Edit icon when it appears.
- On the Action Editor, select the API call to be used with the action from the list. This API call should have been set up earlier in the API Manager (for more information, see Using the AUTTO API Manager).
- Under the Parameters section, select the square brackets for the parameters that will be sent to the API.
- Under the Response section, enter the name/s for the square bracket/s to which the response data will be saved.
NOTE: The Response section always contains an API Success Yes/No output that will return either Yes or No depending on whether the API connection succeeded in sending data or not. You are required to provide a name for the square bracket to which this message will be saved. Depending on your requirements, you can then add a Condition action that will allow your users to take the workflow into different paths based on this output. For more information, see Condition Action.
- Under the Payload section, enter the name/s for the square bracket/s which will be sent to the external system.
NOTE: Payloads can include files that are attached to an AuttoDoc action.
- Click the x button on the top-left to save your changes and close the Action Editor.
NOTE: The Send Data Action is one of several Actions in AUTTO that have a Run for Table option, which allows you to use it against every record in an existing table and enter the results into a new table. Using square brackets, you can then use the new table later on in the workflow. For more information, see Getting Started with Run for Table.
How a Send Data Action Works
The Send Data action does not appear on the User Application. Instead, it runs the API call and sends the outbound [square_brackets] to the external system. It then receives the API's response/s, which it then saves as [square_brackets] for use later in the workflow.
NOTE: When sending a PATCH request, the only response will be that the call has been successful. You can use a GET after a PATCH to check that the fields have been updated.