Domino Code Fragment

Code Name*
One to many/many to one @Replace
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.119.139.104
Description*
The @Replace will do a replace of an exact match (one-by-one) of the elements of a text string. But what if you need to replace one element with several elements, or several elements with just one? The following formula is based on the following fields: TargetField: the field containing the text to be replcaced
Keyword: the "tolist"
KeywordOld: the "fromlist". The formula should be defined in a button, not a field computation in order to work.
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
The formula concatenates the result of a "normal" @Replace with the "tolist" separated with a delimiter. The concatenated string is then @Implode'd to create the new text string list, duplicate entries are then eliminated (@Unique), the entire string then @Trim'ed to eliminate any blanks (when entries are deleted doing a many-to-one replace).
Files/Graphics attachments (if applicable): Code:
@SetField("TargetField"; @Trim(@Unique(@Explode(@Implode(@Replace(TargetField; KeywordOld; Keyword); ",") + "," + @Implode(Keyword; ","); ","))));
@SetField("KeywordOld";"Keyword")