How to de-select a value from a multi-select field? | Community
Skip to main content
Jessica_Sprink3
Level 2
November 15, 2018
Question

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

  • November 15, 2018
  • 2 replies
  • 6888 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 4
November 15, 2018

Hi Jessica,

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

Helen

Jessica_Sprink3
Level 2
November 15, 2018

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 4
November 15, 2018

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

SanfordWhiteman
Level 10
November 15, 2018

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

Jessica_Sprink3
Level 2
November 15, 2018

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

Jay_Jiang
Level 10
November 16, 2018

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
}
?>