Hi, I have a expression rule which has the result : Name - Company - Phoneno.
I concatenated with "-" when I get the above 3 values. In some cases, the name can be blank / company / phone no. If the name is blank, my result is like -company-phoneno. If the phoneno is blank, then it's name-company-How to remove the - if the value is not present ?
Discussion posts and replies are publicly visible
a!localVariables( local!part1: "", local!part2: "part2", local!part3: "", local!stringsToConcat: { local!part1, local!part2, local!part3 }, joinarray(local!stringsToConcat, " - ") )
a!localVariables( local!part1: "", local!part2: "part2", local!part3: "", concat( local!part1, if(a!isNotNullOrEmpty(local!part2), concat(" - ", local!part2), ""), if(a!isNotNullOrEmpty(local!part3), concat(" - ", local!part3), "") )), In this case it will return -part2
Edited my response with something a little more robust.
Thanks Mathieu, I used joinArray and it worked!