tl;dr
Do one of the following:
- Use a Text Collection and not a Picklist Collection for your
accountstagecollection
. Continue to ADD your contactstage
value as you are doing, then later in your Decision element you will be comparing the same data types.
- Create some single Picklist type variables - one for each possible picklist value. Assign the appropriate value to them (e.g.,
picklistVariable_Optout
EQUALS Opt-out), then use those as the Value in each of your Decision element Outcome comparisons (e.g., accountstagecollection
CONTAINS picklistVariable_Optout
).
This intrigued me greatly, so I set up a test Flow (which I would be happy to share...somehow) to attempt to cover as many options that I could think of.
- A Text field and a Picklist field were added to the Account object.
- Picklist values were
Open
, Opt-out
and Demo Booked
.
- On an individual Account record, I added the same value in the Text field as I chose for the Picklist field. (E.g., for Record 1 both new fields had the value of "Open", for Record 2 they both were "Opt-out")
- In the Flow, all of the Account records were retrieved, looped through, and the values of these two fields added to Flow Variables as follows:
Value from this field |
Into this type Flow variable |
Variable name |
Text |
Text Collection |
textFromTextCollection |
|
Picklist Collection |
picklistFromTextCollection |
|
Text Single |
textSingle |
Picklist |
Text Collection |
textFromPicklistCollection |
|
Picklist Collection |
picklistFromPicklistCollection |
|
Picklist Single |
picklistSingle |
The single variables were a curiosity - as I ADDed to them in each loop, thus creating one long, continuous string.
Finally (probably should have started here) I looked in Salesforce Help > Docs > Automate Your Business Processes > Flow Operators in Decision and Pause Elements:
Collection
Check whether a Collection resource's value contains or matches another value or resource.
Operator |
True if... |
Supported Data Types |
Contains |
An item in the collection that's selected for Resource contains the exact same value as Value |
Resource of the same data type. |
Picklist
Check whether a Picklist resource's value matches or contains another value or resource.
NOTE: These operators treat the resource’s value as a text value.
Operator |
True if... |
Supported Data Types |
Contains |
The value for Resource contains what's entered or selected for Value |
- Picklist is included in a long list of data types |
|
For example, if the value of {!varPicklist} is yellow-green, the condition {!varPicklist} Contains green evaluates to true |
|
The results of the test Flow match exactly with the documentation:
- When the Collection was of Text type and compared directly to text typed into the Value box, it worked.
- When the Collection was of Picklist type and compared directly to text typed into the Value box, it did NOT work.
- When the Single (non-Collection) variable was of either type and compared directly to text typed into the Value box, it worked.
So in order to test this further, I created three Picklist single variables to use essentially as constants (you cannot create a Flow Constant of Picklist type). A new first element in the Flow set these variables:
Variable |
Value |
picklistVariable_Open |
Open |
picklistVariable_Optout |
Opt-out |
picklistVariable_DemoBooked |
Demo Booked |
Screenshot:
Next I added a Decision element to compare one of the Picklist Collection variables to the new Picklist single "constant" variables:
...it worked!
EDIT
I just re-read your chat discussion with @PhilW and discovered something you said that did not register with me the first time I read it:
[A]t the start of decision as well as at the end I have Picklist record types in the middle while making decision I need to convert collection picklist variable to Text data just to decide and later update picklist from that decision. I now find trapped...
So in your specific case I would suggest the second option above - especially since it is Record Types and thus is a restricted Picklist, thus making it easy to create a Flow Picklist variable for each possible value.