name field shows null values

ryadavalli
Tera Expert

For some reason, the list view of the name column on the user record shows up null as part of name field. but when I click on it, it displays normal first name last name in the name field.

14 REPLIES 14

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ravali,



You may find below thread helpful.


Re: Column shown blank in list view in spite of having values


Thanks Pradeep, but my issue is more about the way it is displayed.


In the list view the manager field shows   A NULL B


In the form view the name field shows A B.



We had a recent change made to the name field calculation, we added logic to include the middle name as a part if exists else just have first last name in the name field on user record. But It seems to be working fine as form view shows it properly.


If you changed the calculation, but not the record, you will need to force the record updates on the user record with a script like this:



WARNING: UNTESTED CODE



var u = new GlideRecord('sys_user');


u.query();


while (u.next()) {


        u.autoSysFields(false);


        u.setWorkflow(false);


        u.setForceUpdate(true);


        u.update();


}



That will force the calculated field to be updated and stored in the database (where the list gets it.)


HI Chuck, I will try implementing this, But with the feed coming in daily, will it not have to auto set the values. And is it daily run or just one time after we change the calculation on the name field for the user record.