Looking for information about ProntoForms features and functionality? Visit our Product Documentation Portal.
This topic provides step-by-step instructions to configure a Salesforce Apex Rest Data Destination.
A Salesforce Apex REST Data Destination enables the interaction between ProntoForms and a Salesforce or Apex Rest API endpoint. With a Salesforce Apex REST Data Destination, you can fully utilize the data collected in ProntoForms for custom actions in your Salesforce org.
How a Salesforce Apex REST Data Destination works
You can configure a Salesforce Apex REST Data Destination to enable ProntoForms to
interact with the Salesforce REST API functions for standard objects.
For example, a Salesforce Apex REST Data Destination can push form data to update Chatter feeds.
send a custom message to an Apex REST API endpoint. For example, your developers can write APEX code (as per the Salesforce documentation) to parse the JSON request body that contains data from submitted forms.
Info:The Salesforce Apex Developer Guide describes how a developer should configure an Apex endpoint.
You must be either
a ProntoForms Admin user or
a member of a FormSpace group with Can Create permissions.
Either a Salesforce Connection already exists in your ProntoForms FormSpace, or you are a ProntoForms Admin user and can create a Salesforce Connection.
Make sure that the ProntoForms team has a Problem Contact Email Address. If the system fails to update records in a Data Destination, the Problem Contact Email Address gets the error message and details.
Obtain the required header parameters and the URL for the REST API endpoint that you want to call.
Configure a Document with a Request Body formatted as per the Salesforce requirements, and then link the Document to one or more forms.
Select the Salesforce Apex REST Data Destination
In the ProntoForms Web Portal, go to Manage Forms > Data Destinations.
Select Create Data Destination.
- From the Cloud Service Integration list, select Salesforce Apex REST Data Destination.
On the Destination Basics tab, you can configure the name and other preferences:
Auto-link newly created forms and specific document types to this destination.
Disable the destination (to configure the destination for future use).
Select the number of times the destination fails before the system sends a problem notification.
The following image shows how to configure the Destination Basics settings.
Name your Data Destination.
The name helps you to identify and differentiate this Data Destination from other Data Destinations in your FormSpace.
Enter a Unique ID.
The system automatically generates a Unique ID based on the name. You can change the system-generated Unique ID to any alphanumeric or special characters, but the ID must be unique within the FormSpace.
Do you want to set up this destination, but temporarily prevent sending submitted form data to it?
If yes, select the Disable this destination... option. This prevents the execution of the Data Destination, even if you link it to one or more forms. You can save the configuration and enable the destination later.
If no, clear the Disable this destination… option to enable this destination for immediate use.
The Auto-Link new forms… option automatically links new forms created or imported in the same FormSpace to the Data Destination. Do you want to auto-link forms?
If yes, select this option.
Result: The system prompts you to auto-link documents. Go to step 5.
If no, clear this option, and then go to step 6.
The Auto-Link documents… option applies to auto-linked forms. This option saves you the effort of specifying a list of documents for each new form. Do you want to automatically link documents to this Data Destination?
If yes, select this option, and then select the documents to link.
If no, clear this option.
For Error Handling, from the Wait to send failure notification… list, select your preferred frequency.
If a Data Destination fails to execute, the system continues the attempts to execute it on a regular schedule. The system sends emails to the Problem Contact Email Address based on the configured frequency.
Tip: Most failures correct themselves and require no intervention.
Filtering gives you greater control over which submitted forms are sent to your Data Destination. The Data Destination executes only when all conditions configured in the Filtering settings are met.
Keep the default settings or configure additional filter rules. Filter rules enable you to apply more conditions that determine whether the submitted form data gets sent to this specific Data Destination. You can apply filter rules to each of several Data Destinations to direct submitted forms to different destinations.
The following image shows how to configure the Filtering settings.
Select at least one Form Version State.
If you want the Data Destination to receive data from… Then select... previous form versions, not currently in use
For example, you sent data from form submissions to an Email Data Destination. You now prefer to store all data in Salesforce instead. You can select Archived to send data from previous forms versions to Salesforce.
Note:Make sure you link this Data Destination to the previous form versions: Manage Forms > FormName > Version History > Version > Form Outputs > Edit Form Outputs
the latest form version, currently accessible to front-line workers
For example, you change a form to reflect the new product specifications. You can select Active to send data from only the latest form version to Salesforce.
forms used for testing
For example, you dispatch a draft form to a few app users with Can Test permissions. You can select Draft to send data from the draft form to a Salesforce Sandbox. In this example, your Salesforce Connection must be configured as a Sandbox connection.
Select at least one Form Submission State.
Complete—execute the Data Destination when front-line workers submit complete forms.
Incomplete—execute the Data Destination when front-line workers submit incomplete ProntoForms Teamwork-enabled forms (Enterprise tier only).
Dispatch Declined—execute the Data Destination when you dispatch a prepopulated form to a ProntoForms app user and the app user declines the form.
In the Filter Rules section, you can apply conditions to execute the Data Destination based on form data and metadata. For example, you can create a rule to execute the destination only when a question has a response of “Pass”.
Do you want to execute the Data Destination only if the submitted data matches all of the rules?
If yes, select Match All. The destination executes if the submitted data matches all of the rules.
If no, select Match Any. The destination executes if the submitted form data matches at least one rule.
Note:The Match Any/Match All option applies to the conditions defined in the Filter Rules section only. The Data Destination executes only when all conditions for Form Submission Filtering and Filter Rules are met.
Input Expression—enter a DREL expression to specify the form data or metadata to match.
Filter Expression—enter a regular expression to define the string that you want to match, for example,
Info:The topic Applying Filters to Data Destinations describes in detail how to configure the Filtering settings.
The following image shows how to configure the Connection settings.
The Connection Configuration options available to you in this section vary depending on your account role settings and existing Salesforce Connections.
Do you have a ProntoForms Admin role?
If yes, you can either select an existing Salesforce Connection or configure a new one.
If no, you can only select an existing Salesforce Connection that’s configured for your current FormSpace. If the system displays No available connections, contact your company’s ProntoForms administrator for help.
Select an HTTP Method.
Post uses data from a submitted form to create a record in Salesforce.
Put uses data from a submitted form to create or replace an existing record in Salesforce.
Patch uses data from a submitted form to update part of an existing record in Salesforce.
You can pass additional parameters to the endpoint by defining a set of key-value pairs in the Headers section. You can even use DREL expressions to populate the values with data from submitted forms.
For example, you might store different forms in different locations within Salesforce, based on the form name. Enter a Key that identifies the location and the Value Expression
%fto send the form name as the value.
The following image shows examples of other key-value pairs, in this case, defined by static text rather than a DREL expression.
A custom URL prefix enables you to target specific locations in the Data Destination. Does the endpoint use a custom URL prefix?
If yes, from Apex REST Prefix list, select Custom and then enter the prefix.
If no, keep the default value /services/apexrest.
Enter the Apex REST Endpoint URL. You can use a DREL expression to dynamically generate the URL.
Salesforce Data Destinations typically return a record ID to ProntoForms. These responses enable you to make sequential requests, typically to create parent-child relationships when creating Salesforce records.
Info:The topic Destination Response Outputs explains how these work and provides sample use cases.
On the Response Configuration tab, select either the Don’t store… or Store all… option as shown in the following example.
Create and save the new Data Destination
Once you configure all required settings, select Create.
Result: The system creates your Salesforce Data Destination in ProntoForms and displays the Data Destination details page. You can now link the Data Destination to forms in the same FormSpace.
Tip: Test and troubleshoot a Salesforce Data Destination before you use the Data Destination in a live Salesforce environment.