List field with choices doesn't work on Workspace

Dennis2
Kilo Expert

Hi all,

I have created a List field with some choices on a form. It works in UI16 but not in Workspace.

Thoughts?

UI16

find_real_file.png

 

WORKSPACE

find_real_file.png

Thanks in advance.

 

1 ACCEPTED SOLUTION

Ian-Fusion3
Tera Guru

I actually just was dealing with this same problem. I didn't want to create another table to store the values. The workaround I found was to keep the choice values, but then add a reference to the List field of 'sys_choice' and set the condition to be: element = [column name]

That way you can use your choices and it works in Workspace.

View solution in original post

8 REPLIES 8

Hi. Can you explain how to got this to work??  I've been trying the same thing and can't get it to work. Help!

 

Virag1
Tera Contributor

Hi @Ian-Fusion3 ,

 

I'm trying to create choice field where choices are just True & False but these choices are not displaying on the BCM Workspace and field is displaying values on UI(Native View).

I tried creating the True/False field as well but that is also not working.

 

Any Suggestion would be soo appreciated!

JJ_C ortez
Tera Contributor

has anyone figured this out yet? Still an issue. found this Explanation from SN but no suggestion of other method.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0813643. There is a condition on dictionary entry that excludes the sys_choice table from being used.

Not sure if it is of interest to anyone anymore, but running into the same problem I have come up with a solution: remote tables.

Let's say I need a list that allows selecting one of the incident categories.

I'd create a remote table with one column: Label (u_label) - make this the display value.

Sys ID (sys_id) is added automatically by SN.

I'd than add the definition for the remote table as:

(function executeQuery(v_table, v_query) {
    var $chl = GlideScriptChoiceList.getChoiceList('incident', 'category');

    $chl.removeNone();

    for (var i = 0; i < $chl.size(); i++) {
        var $ch = $chl.getChoice(i);

        v_table.addRow({
            'sys_id': $ch.getValue(),
            'u_label': $ch.getLabel(),
        });
    }
})(v_table, v_query);

Not I can use this remote table as reference for the List field - sys_ids will actually be choice values.

Also don't forget to add proper ACLs to the table, so that users who need to be able to work with these "choices" can too.

Of course this works in global and you'd need to "shim" it (move the logic of returning the array of records into a globally accessible Script Include in scope "Global") to work in private scopes.