How to populate list with script include and client script

Steve42
Tera Expert

I have a script that populates a listbox with the displayValue.  That is not going to work because I have comma's in the names of the companies that are in the listbox.  This is not a list collector it's a list find_real_file.png

I can get the display value in there but it's not linking to the company when I click the preview it show nothing but if I add it with the lookup field it works as far as giving me the company in preview.

What am I doing wrong?  I have the script include/client script (that populates based on a T/F field). These work but can't put the sys_id in the field and have it work (return the company name with the sys_id showing.

 

1 ACCEPTED SOLUTION

Steve42
Tera Expert

I found the problem, I was referencing the incorrect table.  I was looking at Contracts instead of pulling from Company records.

View solution in original post

6 REPLIES 6

Tried everything. I'm trying to get around a perceived bug in ServiceNow's rendering of a dot-walked multiple choice list. In the end we gave up and provided a modal popup instead from the parent form. But the fact that it renders initially with all the correct "labels" but reverts to showing "values" if you touch the field when dot-walking - it's clearly broken. I thought I might be able to fix it by forcing in the list via script that it would naturally get populated with on it's home form but not getting when being dot-walked from a parent form.

Steve42
Tera Expert

I found the problem, I was referencing the incorrect table.  I was looking at Contracts instead of pulling from Company records.