Adding Outside Values to a Drop Down List
- 16 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Adding Outside Values to a Drop Down List
- Updated on 16 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
In some instances, new/external string values may need to be added to a drop-down list. In a Form, drop-down list options can be created from several sources; these sources include populated data from workflows, specifying a static list directly in the Form Designer, or running a workflow to populate a list of choices. The following example will demonstrate how to add string values to a drop-down list.
Example
External Values not supported in Mobile Forms
Browser Forms only support this feature.
- Begin by navigating to a Designer Folder, click CREATE FLOW from the bottom action panel.
- In the Create Flow window, select and name the default Flow, then click CREATE.
- In the Flow Designer, from the Steps > Favorite Steps section, drag and connect a Fetch Entities step to the Start step.
- Next, connect the Results outcome of the Fetch Entities step to a Show Form step.
- In the Properties panel of the Show Form step, select Pick or Create Form.
- In the Create or Pick window, under Create New name the new Form then click CREATE.
- In the Form Designer, add a Button [Done], Label [Email Address], and a corresponding Drop Down List component from the Form Controls > Favorite Components section.
- With the Drop Down List component selected, navigate to the Properties panel > Input Data > Type menu and change the type to String [Text].The option to add external values is only supported for String lists, not complex types (e.g. data structures).
- Locate the List Input Source menu and select DataName.
- Once the List Items DataName field appears, enter a name for the items in the drop-down list.
- Enable the Allow external values to be selected boolean.
- Save and close the Form Designer.
- In the Flow Designer, select the Fetch Entities step and set Type Name under Entity Fetch Definition to Account.
- Select the Show Form step and set the list of String Accounts to a Select From Flow input mapping and select the AllAccounts.AllEmailAddress in the resulting window.The Entity Results outcome in this example has been renamed to AllAccounts for clarity.
- Set the Email Address input to Ignore.
- Next, add another Fetch Entities step configured with Account as the Type Name.
- Enable the Show Path For One Result boolean.
- Locate the Fetch Criteria selector then click Add New.
- In the Add Fetch Criteria window, select emailAddress from the Field Name menu. Click OK.
- Navigate to Inputs > email Address and change the mapping to Select From Flow then select Email Address.
- Next, add two Create Data steps to the workspace and connect one to the single Result path from the Fetch Entities step.
- In the Properties panel of this Create Data step, locate Data > Data to Create click Show Editor.
- In the Data Definitions window, add SelectedAccount with an Account type. Click CLOSE.
- Next, change the input mapping on the Selected Account input to Select From Flow and select EntityResult.
- Then, connect the second Create Data step to the No Results path of the second Fetch Entities step.
- In the Properties panel > Inputs > Selected Account, change the input mapping to Build Data.
- When the Properties option appears, click the [...] and locate and select EmailAddress. Click OK.
- Then, change the EmailAddress input mapping to Select From Flow and select the Email Address string.
- Then, connect the Create Data outcomes to the End step.
Debug
- Click Debug in the top bar; this will automatically save the Flow.
- In the Debugger, click FULL.
- Select an existing email address and observe the Flow run successfully.
- Create a new session and attempt to add a new drop-down list value and after the Flow completes, click View Inputs and Outputs on the Create Data step and notice the new input information.
Was this article helpful?