Choice list value not showing up on table view/workspace view

JulienRouge1549
Tera Guru

I have a choice list which is dependent on a variable to determine how it's populated. This works fine but, when viewing the list field values from a table or workspace view, nothing shows up:
table

JulienRouge1549_0-1780062165522.png

workspace:

JulienRouge1549_1-1780062206647.png

Now, selecting the actual values, it'll show that there is actually a value in there:

JulienRouge1549_2-1780062262454.png

But, it won't show unless the option is exited without selecting cancel/ok (i.e turning to the next page or opening another option list). 
I've looked over the display values, the business rules, pretty much anything i can think of. But the only thing I've found which makes the values reappear is turning off the Dependent boolean (use_dependent_field) which makes them show up again. Since that's not an ideal option, has anyone expirienced this before? How can i solve this?

1 ACCEPTED SOLUTION

Thanks!
Turns out that this seems to be an issue with the Australia release as we were able to get back the fields on Zurich. I'm going to submit a ticket but thank you for your advice. 

View solution in original post

4 REPLIES 4

Tanushree Maiti
Tera Patron

Hi @JulienRouge1549 

 

Refer: https://www.servicenow.com/community/itsm-forum/list-field-with-choices-doesn-t-work-on-workspace/td...

KB1514236 Sub Category field choices dependent on Category field are not rendred in agent workspace 

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

So, I'm not certain if the first article is related to my issue. As for the other one, it's not just the list options which rely on the dependent variable it's also the ones that should populate when the dependent is false. So I don't think the articles work 

DivyV
Tera Expert

Ah, I've run into this exact one — dependent choice fields rendering blank in lists while working fine on the form. It's a frustrating, subtle one, so you're not missing anything obvious.

The short version: this is a known limitation of how lists (and especially the Workspace/Agent data grid) render dependent choices, not something wrong with your config. On a form, the field knows the dependent value (the Organization) and can resolve the right choice label. In a list cell, the renderer often doesn't carry that dependent-value context, so it can't match the stored value back to a sys_choice row and just paints blank. That's also why flipping off the "Use dependent field" dictionary attribute makes them reappear — without dependency it only needs the value, not value + dependent_value.

A few things worth checking / trying, roughly in order of least-invasive:

First, confirm the data side is actually fine (it almost certainly is): open a sys_choice record for one of these and check that both the value and the dependent_value exactly match what's stored on the record, including case. A whitespace or case mismatch on dependent_value will make it resolve on the form but not in lists.

Second, the cleanest workaround I've used is to keep your dependent choice as-is for data entry, but add a separate read-only string field that mirrors the label, and show that in your list/workspace views. A before insert/update Business Rule is the most reliable since it covers list edits and imports too — something like:

(function executeRule(current, previous) {

    if (current.u_role.changes()) {

        var label = current.u_role.getDisplayValue();

        if (label)

            current.u_role_label = label.toString();

    }

})(current, previous);

Then put u_role_label on the list/workspace view instead of u_role. Not glamorous, but it's stable and survives upgrades.

One caveat: I'd test the mirror approach in a sub-prod instance first, and double-check getDisplayValue() returns what you expect for the dependent choice in a server context — if it ever comes back as the raw value, you can resolve the label directly off sys_choice filtering by name (the table), element, value, and dependent_value.

Give the data-check a look first — if the dependent_value matching is clean, the mirror-field route should get your lists looking right without disabling dependency. Happy to dig further if it's still being stubborn.

Thanks!
Turns out that this seems to be an issue with the Australia release as we were able to get back the fields on Zurich. I'm going to submit a ticket but thank you for your advice.