In my case, the pipe ( | ) separated list contains a maximum of five parts.
Currently, I split each part into a dynamic string variable and add these variables as items in the dropdown.
This approach works fine, but I'm wondering if there's a simpler way to achieve this. With JS, you can simply write text.split("|")[0];
E.g. to extract the 1st part:
ifElse(equal(indexOf({{Outbound.myfield}},"|"), -1), substr({{Outbound.myfield}},0), match({{Outbound.myfield}}, "^([^|]*)", "", 1))
2nd part:
ifElse(
equal(indexOf({{Outbound.myfield}}, "|"), -1),
"",
match({{Outbound.myfield}}, "^[^|]*\\|([^|]*)", "", 1)
)
etc...
------------------------------
Thomas Stutz
------------------------------
Original Message:
Sent: 03-12-2025 04:50
From: Nuno Paulo
Subject: Display a Comma-Separated List in a Dropdown Script Component
Hi Thomas,
I didn't test it but do you already tried to split that string by comma to assign to a collection and use that in the drop down?
Hope this works or lighting to the solution.
Best regards,
Nuno Paulo
------------------------------
Nuno Paulo
Original Message:
Sent: 03-11-2025 04:45
From: Thomas Stutz
Subject: Display a Comma-Separated List in a Dropdown Script Component
I have an outbound field that contains a comma-separated list of values, such as:
111,222,333,444,555,666
How can I display these values in a Dropdown script component so that each value appears as a separate selectable option?
Any guidance or example code would be greatly appreciated!
#ArchitectureandDesign
#Implementation
------------------------------
Thomas Stutz
------------------------------