glide_list set with display values with a comma in it, are not parsed correctly


When creating or updating a record that contains a glide_list field (for example, watchlist), if the input value has a comma in any of the values, the API treats the input as two (2) different values instead of one name that contains the comma.


  1. Create a new user with a name of "test, user one".

  2. Execute the following:

    function test() {
        var a = new GlideRecord("incident");
        a.setDisplayValue("watch_list", "test, user one, abraham.lincoln");

    Note that watch_list has test, user_one, abraham.lincoln as three different entries.


The glide_list field parses values set as a comma-separated values.


There are several possible options:

  • Remove commas from the display name of the relevant records.

  • Set the glide_list field with the relevant sys_id of the target records.

  • Use a string field to populate the required value.

  • Use a custom separator for values with commas that is then processed using logic within the instance.

    glide_list field parses values set as a comma-separated list. The display value from getDisplayValue() can be customized with a separator by setting the property glide.ui.glide_list.separator to a string.


Article Information

Last Updated:2017-10-02 06:36:14