2

Is it possible, as of winter 23 release, to remove a multi select picklist value in a flow assignment? It's very easy to add a value with add item operator, but I can't seem to figure out how to remove an item.

I have a datatable for each contact role I would want to remove from a contact. E.G. I have a fraud datatable. If a user selects one or more of the contacts, I'm trying to loop through the individual contacts and remove the "Fraud;" value from the multi select picklist field.

I've tried various things and looked at formula fields but nothing I've found is working.

Is there any way to do this? Screenshot of current single record variable i'm trying to update the multi select picklist value on enter image description here

1

1 Answer 1

1

Try using a formula with a SUBSTITUTE expression that removes the desired value. It seems that Salesforce stores the data as a semi-colon delimited list. So removing the value and associated semi-colon seems to do the trick. However you must first assign your data to a text variable and then update the text variable. Then update your field with the text variable.

Details:

  1. In your first Assignment element, create a new text variable (let's call it vRoles) and set it equal to the multi-select picklist field.
  2. In a second Assignment element set your vRoles variable = a formula. Create a formula like this:
    SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({!vRoles},'Fraud;',''),';Fraud',''),'Fraud','')
    
    This formula has 3 substitutes to remove the role of Fraud if it is the first/middle role, if it is the last role, or if it is the only role.
  3. Finally, in a 3rd assignment element set your field equals to your vRoles variable and then you can update your object or do whatever other processing you need to do.

Here's an example flow I built that removes a role using the above model: Example_RemoveRole

Assignment1 Assignment2 Assignment3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .