How to de-select a value from a multi-select field?

Highlighted

How to de-select a value from a multi-select field?

Hi all, we have a Solution Engagement field to keep track of all the products that prospects are engaged with. I'm already using this sort of workflow to populate new products into the Solution Engagement field: Handling Multi-Select Fields in Salesforce

But what I want to know is, how can I de-select a value that's already populated on a prospect's record? For example, if a sales person calls the prospect and decides they're not a good fit for Product A, how do I remove that value from the Solution Engagement field without nulling out other values in that field? (i.e. I don't think I can just say Change Data Value, change to NULL). Thanks!

13 REPLIES 13
Level 5 - Champion

Re: How to de-select a value from a multi-select field?

Hi Jessica,

You can perfectly say Change value ABC=NULL. This should work - I am doing it all the time

Helen

Re: How to de-select a value from a multi-select field?

Hi Helen! But won't that null out ALL values? If I have A;B;C as values, I only want to take away A, leaving B and C...

Level 5 - Champion

Re: How to de-select a value from a multi-select field?

Oh I see. No, that won't work then. How do you store the values? In the text area?

Re: How to de-select a value from a multi-select field?

Yes - in this format - A;B;C which then checks the relevant values in the Salesforce multi-select picklist. Can't for the life of me figure it out! May need to handle in Salesforce.

Level 5 - Champion

Re: How to de-select a value from a multi-select field?

I would suggest considering creating custom fields for A, B, C and keep them updated dynamically. If you need to keep them in one field, then you can use tokens to concatenate and update the target field. Multi-select is not well supported by Marketo. Building all the choices seem too much pain.

Re: How to de-select a value from a multi-select field?

The way to do this is via webhook, which can parse semicolon-delimited (or anything-delimited) strings and return them with certain values excised.

Re: How to de-select a value from a multi-select field?

Sanford, this is great - do you have an example of how this is done? Haven't parsed things in this way before. Thanks!!

Level 7

Re: How to de-select a value from a multi-select field?

How are you triggering the data value changes flow?

i.e. how are you selecting which value inside the multi picklist to take out?

or is this data hygiene that you'd run manually?

Anyway here's a php webhook that does the trick:

<?php

if(isset($_POST['data']) && isset($_POST['var'])){

  $data = $_POST['data'];                                // e.g. "product a;product b;product c;product d;"

  $var = $_POST['var'];                                  // e.g. "product c"

  $response = preg_replace( "/$var\;/", "", $data);      // gives "product a;product b;product d;"

  echo json_encode(array("response"=>$response));        // In Marketo map 'response' to update multi select field
}
?>

Re: How to de-select a value from a multi-select field?

Will both false positive and mangle output on partial match, you must  split on the delimiter