I have a checkbox with the following options
Blue (BL)
Red (RD)
Magenta (MG)
Green (GN)
The output I want is BL,RD,MG,GN
So, I tried using this script:
findPatternIgnoreCase(%{19401},"BL|RD|MG|GN"
It is not working unfortunately. Help!!!
Hi @Marc Jason Mutuc,
what kind of field type is your target field? If you try to copy the field values to a text field, it's as simple as just using the field code - in your case %{19401}.
What are you trying to implement by using findPatternIgnoreCase?
Do you want to return a list of all available options or only the ones checked?
Best regards,Thorsten
The target field is a Text Field, Single Line.
What I'm getting when I just parse the field is Blue (BL),Red (RD),Magenta (MG),Green (GN) but what I want displayed is BL,RD,MG,GN.
That's why I'm attempting findPatternIgnoreCase but can't really get it to work.
Any other options we can use to get the desired output?
since you don't want to return the options as is, but are trying to manipulate those values, your expression has to be a litte more elaborate:
toString(textOnStringList(toStringList(%{19401}, ","), substring(^%,length(^%)-3,length(^%)-1)))
In short, the expression iterates over your options, cuts away the first n characters including the bracket as well as the last bracket and then rebuilds a new list with the returned values. If all your options follow the same syntax, this expression should do the trick.
Best,Thorsten
Cool! Can I set a variable for it? or should I just add it in my concatenated text? I would prefer the cleaner one of course!
It looks like you're new here. Sign in or register to get started.