Creating Dynamic Choices In Cloud Flow

I started using Salesforce’s Cloud Flow (aka Visual Flow) to implement some business logic and was looking to implement the equivalent of a user selectable lookup option in a flow.  I ran across this question about handling multiple records and Elcalvo Mike suggested a dynamic choice.  BigWill asked how this could be used to do a partial match on account names.  So, I created a simple flow to demonstrate this.  

The screenshot in the below left shows a user entered the string “test” into a Screen Input Field that I named “Account_to_search_for”.  The screenshot in the below right is the dynamic choice drop down listing accounts with “test” in their name.  The user clicks a selection to save their choice.

Dynamic Choice example first screenshot      Dynamic Choice example second screenshot

 

This next screenshot illustrates creating the dynamic choice.  It performs a record lookup on Accounts whose Name is a partial match for the user input (the blue highlighted “Account_to_search_for” is the Screen Input Field from the above left screenshot).  The data listed in the drop down are all the returned records’ Names (specified in the Choice Selected Value).  

Dynamic Choice Screenshot

Dynamic Choice Screenshot

One last feature is under the “Additional Options” which lets you specify what fields get saved for the user selected record.  For my example, I saved the account name and Salesforce ID for display.

Screen Shot 2014-07-09 at 11.58.00 PM

Hope this helped!