- Set Up the Data Source
The Salesforce Query Data Source retrieves data from your Salesforce organization using Salesforce Object Query Language (SOQL). This data can be used to populate a list of options in Dropdown, Radio Button, or Multiselect questions. This data source is intended for obtaining a data set with more than 2000 records.
Tip: Use the Salesforce Report Data Source for data sets that return fewer than 2000 rows. For larger data sets, use the Salesforce Query Data Source.
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.
Note: This article will cover the basics of setting up a Salesforce Data Source. Refer to Creating & Managing Data Sources for full details on configuration options for data sources.
Create the data source, selecting Salesforce Query as the type.
- Name the data source.
- Optionally provide a description.
If this option is selected, users will get a notification from the ProntoForms app after a fetch. It will prompt users to reconcile (send/receive). 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 Query 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 Salesforce Connection or use an existing connection.
Note: Only ProntoForms users with the Admin role can create new connections.
Query: This field uses a SOQL expression, which is used to retrieve data from your Salesforce organization. Please refer to Salesforce documentation for more information about SOQL: 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
- 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.