How do you delete a specific value from a list of values ?
Will substitution by an empty space will do the job ?
I assume by "list of values" you mean a return-separated list in a field.
Substituting the value with an empty space does not eliminate the value, just changes the value to empty (or space, depending on whether "empty space" means "empty string" or "space").
There are a number of custom functions (eg: one, two) that solve this problem but they seem a bit overcomplicated to me (just read the comments to get an idea of how complicated this problem is being made!). Here's what I came up with:
Substitute ( ListOfValues ; ["valueToRemove¶";""] ; ["¶valueToRemove";""] ; ["valueToRemove";""] )
The first substitution removes the value unless it is the last value. The second substitution catches it if it's the last value. The last substitution would be necessary only if it were the only value. If you have multiple occurrences of the same value, this suggestion would remove them all, so if your requirement is different, you'll need another solution.
The reason the custom functions you read about are more complicated is because they avoid unintended side-effects. Your code would do the following:
If the list was "Bob¶Sue¶Bobbing¶Mary" and you want to remove "Bob" from the list, here's the result using your code:
I don't think you intend that result.
There's a lot of discussion about making this work properly. See the code (and the comments!) at: https://www.briandunning.com/cf/1175
There's also an alternate way of doing it, by Debi Fuchs: https://www.briandunning.com/cf/2168
Ah right, of course. Thanks.
Thank you for this answer. I am going to use the Debi Fuchs custom function.
Retrieving data ...