Dynamic Picklists are multiple-choice questions that get their list of choices directly from Salesforce. Values are populated from Salesforce when the form loads, so the choices in your picklist always stay current without having to refresh the schema.
You can configure your Dynamic Picklists to get their list of choices from:
a list of Salesforce object lookup results
a Salesforce picklist (a type of field)
To use Dynamic Picklists, you will need:
- Permission to use the Dynamic Picklist feature (controlled by your FormAssembly administrator)
- Note: This permission is not set by default on new accounts so you may need to edit your permissions.
- An Enterprise or Cloud Compliance plan
- Access to a Salesforce instance.
Setup Dynamic Picklists
There are two parts to setting up a Dynamic Picklist:
In Form Builder 5.0, set the source of your multiple-choice question to Salesforce (Step 1).
In the Salesforce Prefill Connector, configure the Dynamic Picklist settings to pull the appropriate data directly from Salesforce (Steps 2-6).
Part I: Set Source of Choices
Step 1A: Set source for a new question
Begin with adding a new multiple-choice question (Drop-Down Menu, Radio Buttons, Checkboxes, or a Multi-Select List) to your form. Give the field an appropriate name and click the Choices button in the editing toolbar, which will open the Setup Choices modal.
Please Note: A dynamic picklist can be created with any multiple choice question type, but once the dynamic picklist has been configured, it will always display as a dropdown box.
On this modal, you will see 3 options: Manual Input, Datasets, and Salesforce.
Clicking the Salesforce tile will set the source of that question’s choices to Salesforce and open the Edit Choices modal.
Step 1B: Change source for existing question
Start by selecting the question you would like to update, then click the Choices button in the editing toolbar to open the Edit Choices modal. The title of the modal will be appended with the current source of choices for the question you have selected.
To change the source of choices, click the dropdown button next to the current source and then select Salesforce from the dropdown menu. At that point, you will see the modal reflect information about Dynamic Picklists.
Part 2: Configure your Dynamic Picklist
Step 2: Access the Salesforce Prefill Connector
Dynamic Picklist can only be configured in the Salesforce Prefill Connector. You can access your connectors by clicking the plug icon in the left side navigation directly from within the Form Builder, or the “Save Form and Manage Connector” button on the Edit Choices: Salesforce modal. Dynamic Picklists can be added to existing prefill connectors or a new one can be created.
Step 3: Select Relevant Salesforce Object
To begin, select the type of Salesforce object that contains the information you need to retrieve. This information could be records for that object, or particular picklist included on the object.
Step 4: Set Object Lookup Query
For a Dynamic Picklist to prefill choices, you must enter a valid query in the Lookup section at the start of the connector. The object lookup query is a powerful tool that can support a variety of operators and multiple conditions. To find the best query, you may need to experiment with different options.
- For “Salesforce object lookup results”, your query must logically include all records you would like to display.
Please Note: When using a lookup, the Dynamic Picklist data is currently sorted by the order they were last modified in Salesforce.
For “A Salesforce picklist field”, your query must logically include at least one result that contains your desired picklist.
Here are some examples of popular queries for Account object lookups that will help you configure dynamic picklists:
|Scenario (Object = Account)||Query|
Account records that have a value in the Account Name field
(since Account Name is a required field for all Account records, this query will retrieve all records)
Account Name not equal to Formula: ""
Account records that are active and have the industry set to energy
Active equals Formula: Yes
Industry equals Formula: Energy
Account records that have the industry set to energy or do not have a value for the industry field
Industry equals Formula: Energy
Industry equals Formula: ""
Step 5: Map Your Dynamic Picklist
Scroll down to the section titled Dynamic Picklists and click the Map Your First Picklist button (this section will not appear until you have selected an object for retrieval).
Use the controls to set the choices that will be populated to the Dynamic Picklist field on your form.
These questions: Choices include any question where the source of choices is set to Salesforce.
Get their list of choices from: Choose between pulling data from a list of Salesforce records or all the options on a particular Salesforce picklist.
If you assign a question to get its list of choices from “A Salesforce picklist field,” you will be prompted to specify the name of that picklist. Getting the list of choices from a Salesforce picklist requires a valid lookup query that includes at least one record containing the desired picklist.
If you assign an question to get its list of choices from “Salesforce object lookup results,” you will be prompted to select the field that is displayed for each record. Getting the list of choices from object lookup results requires a valid query that includes all of the records you would like displayed as choices.
Once you have set your values appropriately, click the Check button to confirm. (You will still need to Save your connector settings before any changes take effect). In the event that you need to remove or edit your Dynamic Picklist configuration, you can click the Edit button in each row.
Step 6: Test your Dynamic Picklist
Before you test your Dynamic Picklists, make sure you have:
Saved changes to your form in Form Builder 5.0
Saved changes to your Salesforce Prefill Connector
Enabled the Salesforce Prefill Connector
To test your Dynamic Picklists, you must view the live form.
Dynamic Picklists are not currently multi-select but this option is on the roadmap. As a workaround, you can add a Dynamic Picklist and make it a repeatable so respondents can add another option.
- Add a Dynamic Picklist to your form
- Click on the picklist and choose Options
- Click Repeatable Option and click the toggle to enable
- Save your form and test your form.
Please Note: You will not be able to map this to a Salesforce multi-select picklist field as this is currently just a workaround at this time. You will need to map it as a repeated instance.
Choices from Salesforce Object Lookup Results
- Angela is creating a form that will link new business to existing accounts. She already uses the standard Account object to store and manage account information in Salesforce. By using a Dynamic Picklist, she can create a field on her form that will show a choice for each record in her Salesforce instance. As she adds and removes records in Salesforce, the choices on her live form will automatically update.
Choices from Salesforce Picklist
- Amit uses lots of different forms to facilitate student registration. Each of his forms needs a field for the anticipated start term, but the list of available choices changes every semester. By using a dynamic picklist, Amit can populate the “Anticipated Start Term” field with a list of choices from his “Anticipated Start Term” picklist in Salesforce. When Amit updates his picklist in Salesforce, it will automatically update on every one of his forms using that dynamic picklist.
Dynamic Picklist Limits
Dynamic Picklists do not currently have a limit on the number of values it will pull in.
NOTE: Prefilling over 250 records will potentially cause slower than normal loading times and impede form performance. We recommend adding additional criteria to narrow down prefill results or to use more than one field or fields to show your results.
Please keep in mind that there is also a Salesforce API call limit that will limit your findings. Whatever is retrieved in that call is what will display and we are unable to make multiple API calls for the data in one field. For more information on your account specific API call limits, please refer to Salesforce.
Dynamic Picklists now have the option of restricting values. You'll be able to toggle the switch to allow or not allow outside values from respondents.
- In the dropdown list on the live form, you will see the first 39 results until you define the query further by typing in a letter.
- Example: Your list has 200 countries. When you look at the form, it will show the first 39 of the list. If you type in a letter, say A, it will show the first 39 items that start with A.
Lookup Account Name and Send ID to Salesforce
At times, you may want to set up an Account Name dynamic picklist but send the ID to Salesforce. In order to set this up, you'll need to lookup the Account Name. In the setup below, this will look up Account Names that were created after January 1, 2019 and list those in the picklist.
In the Salesforce Submit Connector, you will create a lookup and map the Account Name to the Dynamic Picklist field.
Sample Connectors Setup
Salesforce Prefill Connector