How to Conditionally Append a Semicolon While Iterating Over a List in Mendix
0
The records currenlty coming like below mentioned image Hi everyone, I'm trying to concatenate names from a list (KSBUserDatabase) into a single string with semicolons separating them. However, I don't want a semicolon after the last name. Here’s the scenario I want to implement: For a single name, no semicolon should be added. For multiple names, a semicolon should be added between names, but not at the end of the final name. I've attempted the following expression in a "Change Variable" action, but I'm getting an error with the if condition syntax: $Var_TechITContact + if (indexOf($IteratorKSBUserDatabase) == count($IteratorKSBUserDatabase) - 1) then $IteratorKSBUserDatabase/FullName else $IteratorKSBUserDatabase/FullName + ';' How can I achieve this behavior correctly using a Mendix microflow or expression? Thanks in advance for your help!
asked
Pushpendra Nayak
1 answers
1
Try something like this:
(if $Var_TechITContact = empty or trim($Var_TechITContact) = '' then '' else $Var_TechITContact + ';') + $IteratorKSBUserDatabase/FullName