How to create an HTTP Request form action type
Form actions are processes triggered by user responses on a form. An HTTP Request action type uses a URL to send or retrieve data. If you are unfamiliar with information in this procedure, contact your IT department.
- Open the form for which you want to add a form action.
- On the toolbar, click
(Connect) and Form Actions. Then click +Add to open the Form Actions page.
- Choose HTTP Request as the form action type, then enter a name for your form action.
This name represents the specific set of instructions or data the action will trigger. Since you can create multiple actions for a single form, use a descriptive name that helps you easily identify its purpose.
For example, if your technicians need current weather information before beginning their work, you can create a form action named Get Weather Data to retrieve that information automatically.
- If the endpoint you are calling is secured through a token, in the Data Source for Authentication field, select the data source that you configured in the Data Connection window. The authorization will be called to secure a token prior to calling the request URL. If you have a static token, or do not require authorization to the endpoint, leave this field blank.
- Select the request type. Consult the documentation for your endpoint for guidance on which request type should be used. Request types include:
-Select Get to read/retrieve a resource.
-Select Post to send data to a server to create or update a resource.
-Select Put to send or replace data to a server to create or update a resource.
-Select Patch to apply partial modifications to a resource.
-Select Delete to delete a resource from the server. - Enter the request URL. This is the endpoint that is called to perform the form action. You can include a merge field in this URL too, if applicable.
- If applicable, enter the request header and value to provide additional information about the request.
- If applicable, enter the request content JSON or XML, then select the fields you want to include for the form action.
- Enter the response example.
- Once you have the fields you want selected, click Preview to open a Preview window. Select the form submission to view a preview of the form action.
- Click Save, then click OK to close the Form Settings window.
- An Action button can now be added to your form that will execute the action.
- Click
(Save button) on your form to save the form action.
- Click
(Preview button) to test the form action. In the following example, once the Update Current Weather Conditions action button is clicked the Windspeed and Temperature fields populate, and the form can be completed. Keep in mind data may run and get updated when using the Preview window. We recommend you use the Preview window in a test environment in these circumstances.
- Verify the form action was executed successfully using the Form Actions Log.