This article walks you through updating a multi-picklist field’s values without losing existing values using flow.
Let’s assume you have a multi-picklist field Multipicklist__c on the opportunity object with the following five values.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Now you want to add Option 3 to the multipicklist__c field automatically when an opportunity is updated to closed won without losing existing values.
SOLUTION
Create a record trigger flow on the opportunity object and make it run when the opportunity is updated. Now set entry criteria as below.
Stage → ISCHANGED → TRUE
STEP 1
Create a text variable with the name as ExistingValue as shown in the attached screenshot.
STEP 2
Put an assignment element inside the flow and assign the existing multi-picklist field’s value to this new variable using the assignment operator as shown in the attached screenshot.
STEP 3:
Now create a formula variable with the return type text as mentioned in the attached screenshot.
IF(ISBLANK({!ExistingValue}),
"Option 3;",
IF(INCLUDES({!$Record.multipicklist__c}, "Option 3"),{!ExistingValue},
{!ExistingValue}&";"&"Option 3;"
)
)
STEP 4
Update the record and assign the formula value to the multipicklist__c field as shown in the attached screenshot.
Great. Now activate the flow and you are done.
The final look of the flow.