Valuelist with custom values which need to display the | chr

Hi Servoy,

In several cases we need to have valuelists which have custom values, but the value contains the “|” character (the same one which is used to delimit the display from the real value). In our case we do not have separate display and real values.
Is there a way to “escape” the | character in the valuelists custom values so that it is actually displayed in the dropdown list and not treated as a delimiter between display and real value?
So far we tried several options like “||” and “|” but these do not work. The available help documentation does not mention anything about how to escape this special character… OR perhaps this is a bug and we need to create a case for it?

Hi Rossen,

maybe a bit of a workaround, but you can do this by setting the values with the application.setValueListItems function.

so:
set the custom values of the value list to empty (design time)
then, in a ‘init_valuelist’ function, do something like this:

application.setValueListItems('Aan',['56|34','aa|bb'])

Hope this helps

Thanks Marc,

That does work!

I still think that there should be a way to do this directly in the Valuelist editor…

A couple of caveats:

This doesn’t work. It still displays both values - the display value and return value:

['56|34','aa|bb']

I would do this:

application.setValueListItems('myValueListName',new Array('First Item','Second Item','Third Value'),new Array(1,2,3))

If you set the field you are attaching the valuelist to to a form variable, I would make sure the JSDoc Properties of the form variable is set to: ,variableType:4