(Please note that older articles might not render correctly in mobile view.)
- Set Up the Data Source
- Data Retrieval and Format
- Using Multiple Values From a Referenced Object
The Salesforce Query Data Source retrieves data from your Salesforce account using Salesforce Object Query Language (SOQL). This data can then be used to populate a list of options in dropdown or radiobutton questions. This data source is intended for obtaining a data set with more than 2000 records.
Data sources are usually set up to fetch data on a specified schedule. This allows teams to maintain and update their data through the external service of their choice, minimizing the need to access the web portal.
|Organizations of all sizes use the Salesforce platform to manage customer relationships and power their business in the cloud. Looking for two-way integration? Read more about the ways ProntoForms can connect to Salesforce.|
- Create the data source as described here.
- Select Salesforce Query Data Source as the type.
- Name the data source and optionally enter a Description.
- Set up the data source using the information below.
If turned on, users will get a notification from the ProntoForms app after a fetch. It will prompt users to reconcile (send/receive or refresh). This setting is recommended if it is important that users have the most up-to-date data.
- With "push updates" and an automatic fetch set up, some data sources send a notification for each fetch, whether or not the data source has new data.
- If the fetch schedule is hourly, users may get notifications hourly even if the data has not changed.
- Some users may find these notifications annoying or confusing. Consider the fetch frequency carefully if notifications are enabled.
Automatically fetch new data on a schedule:
- If checked, data will be retrieved from your Salesforce Report at the Fetch Frequency interval.
- Make sure that the team has a Problem Contact Email Address. If a fetch is unsuccessful for any reason, this address will receive an email with an error message and details. Without this email, it may not be immediately clear that a fetch has failed.
- If unchecked, the data source will not be updated automatically. To retrieve new data from Salesforce, the data source will need to be manually updated through the "Fetch New Data" button in the web portal.
Choose Hourly, Daily, Weekly or Monthly. This is how often the data source will fetch new data from Salesforce.
This applies to all fetch frequency options except “Hourly.” Data will be fetched at midnight in the chosen time zone.
- Configure a new Salesforce Connection or use an existing connection.
Query: This field uses a SOQL expression, which is used to retrieve data from your Salesforce account. Please refer to Salesforce documentation for more information about SOQL (external link): Salesforce Object Query Language.
- A simple example of a SOQL statement in this context would be:
SELECT Id, Name FROM ContactWhich would yield all IDs and Names from your Contacts. Sample results from this query could be:
ID Name 4321 John Smith 1234 Jane Doe 2341 John Doe
- Salesforce API:
- Query: Using the Query API is recommended for data sets yielding less than 10,000 results. It has more functions available that are documented by Salesforce here: Salesforce Object Query Language.
- Bulk: Using the Bulk API is recommended for large data sets yielding greater than 10,000 results. It does not support the following SOQL functions: COUNT, ROLLUP, SUM, GROUP BY CUBE, OFFSET, or nested SOQL queries.
Before implementing a SOQL query in ProntoForms, please test the query in the Salesforce Developer Console's Query Editor (see external documentation: Developer Console Query Editor). This will determine if the query is valid within Salesforce. If the query does not function in Salesforce, it will not function in ProntoForms. The Developer Console Query Editor looks like this:
Due to your Salesforce organization's data model being inaccessible to external integrations, ProntoForms cannot troubleshoot SOQL issues.
- If left unchecked, the data source will wait until the specified time and interval to retrieve data for the first time.
- If checked, the first data retrieval will occur immediately after creating the data source.
Using Multiple Values from a Referenced Object: Multiple Data Sources
If trying to call multiple values from a referenced object, please have multiple data sources configured. Currently, ProntoForms only supports calling fields from a single object at a time, resulting in queries calling multiple fields from a referenced object only outputting one field.