Flow has never been good at managing multiselect picklist fields. Over the years, many intrepid flowhanites have provided assistance. Here, we provide an installable Flow Action that leverages last year’s new support for generic types to provide a nice and simple new way to solve problems that use these fields.
Use this new Manage Multiselect Field action to easily do these things:
- Select an additional value for a multiselect picklist field
- Deselect a selected value from a multiselect picklist field
- Check for the presence of a particular value in the set of selected values
- Given a specific record, obtain both the full set of available values and the currently selected values in the form of a List of Strings that can be used downstream in your flow with tools like QuickChoice.
|objectApiName||String||Name of the object where your field is|
|fieldApiName||String||Name of the multiselect picklist field you’re manipulating|
|operation||String||Supported values are CheckForValue, ReturnStringCollection, AddValue, and RemoveValue|
|targetValue||String||Use to specify a value to add or remove, or to check for whether a value is selected.|
|saveAutomatically||Boolean||If set to true, will save any changes made by the action immediately. Note that this will commit any open transactions in the flow|
|curRecord||Record||the actual record you’re examining or changing|
|selectedValuesSemicolonString||String (this is the ‘native’ way that these fields store data)|
|targetPresent||Boolean||Returns a value if action is set to|
Installation note: This package currently creates a multiselect picklist field called ‘Fruit__c’ on the Account object to provide something to run tests on. If that’s a problem, you can install this action without the test class by simply grabbing the main action code here and pasting it into a New Class in Developer Console.