Configure an Adaptive Form for REST Endpoint submit action
Use the Submit to REST Endpoint action to post the submitted data to a REST URL. The URL can be of an internal (the server on which the form is rendered) or an external server.
AEM as a Cloud Service offers various out of the box submit actions for handling form submissions. You can learn more about these options in the Adaptive Form Submit Action article.
Advantages
Some of the advantages of configuring the Submit to REST endpoint submit action for Adaptive Forms are:
- It enables seamless integration of form data with external systems and services through RESTful APIs.
- It provides flexibility in handling data submissions from Adaptive Forms, supporting dynamic and complex data structures.
- It supports dynamic mapping of form fields to parameters in the REST endpoint URL, allowing for adaptable and customizable data submissions.
Configure Submit to REST Endpoint submit action steps-to-configure-submit-to-restendpoint-submit-action
To configure submit action:
-
Open the Content browser, and select the Guide Container component of your Adaptive Form.
-
Click the Guide Container properties icon. The Adaptive Form Container dialog box opens.
-
Click the Submission tab.
-
From the Submit Action drop-down list, select Submit to Rest endpoint.
To post data to an internal server, provide path of the resource. The data is posted the path of the resource. For example,
/content/restEndPoint
. For such post requests, the authentication information of the submit request is used.To post data to an external server, provide a URL. The format of the URL is
https://host:port/path_to_rest_end_point
. Ensure that you configure the path to handle the POST request anonymously.In the example above, user entered information in
textbox
is captured using parameterparam1
. Syntax to post data captured usingparam1
is:String data=request.getParameter("param1");
Similarly, parameters that you use for posting XML data and attachments are
dataXml
andattachments
.For example, you use these two parameters in your script to parse data to a rest end point. You use the following syntax to store and parse the data:
String data=request.getParameter("dataXml");
String att=request.getParameter("attachments");
In this example,
data
stores the XML data, andatt
stores attachment data.The Submit to REST endpoint Submit Action submits the data filled in the form to a configured confirmation page as part of the HTTP GET request. You can add the name of the field to request. The format of the request is:
{fieldName}={request parameter name}
As shown in the image below,
param1
andparam2
are passed as parameters with values copied from the textbox and numericbox fields for the next action.You can also Enable POST request and provide a URL to post the request. To submit data to the AEM server hosting the form, use a relative path corresponding to the root path of the AEM server. For example,
/content/forms/af/SampleForm.html
. To submit data to any other server, use absolute path. -
Click Done.
Best Practices
- When posting data to an external server, make sure the URL is secure, and configure the path to handle the POST request anonymously to protect sensitive information.
- To pass the fields as parameters in a REST URL, all the fields must have different element names, even if the fields are placed on different panels.
Related Articles
- Send email
- Submit to SharePoint
- Submit using Form Data Model
- Submit to Azure Blob Storage
- Submit to REST endpoint
- Submit to OneDrive
- Invoke an AEM Workflow
- Submit to Power Automate
- Submit to Workfront Fusion
- Connect Adaptive Form to Salesforce application
- Connect an Adaptive Form to Microsoft® Dynamics OData
- Connect an Adaptive Form to Adobe Marketo Engage
- Create custom submit action