auto-populate returns the sys ID

Diane22
Tera Guru

the auto-populate works like a charm, except for me it returned a sys_ID instead of the actual value 😞

6 REPLIES 6

Sainath N
Mega Sage
Mega Sage

@Diane22 : As managed by, service owner, service are reference fields on the application table they are returning sys_id’s and that’s how stores value of the reference fields. From the script where you are returning values, please return them with .getDisplayValue() to see the display value of the corresponding entry

 

https://www.servicenow.com/community/developer-blog/servicenow-importance-of-getvalue-and-getdisplay...

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Maik Skoddow
Tera Patron
Tera Patron

Hi @Diane22 

did you fill the form by yourself, or did you open an already existing form?

Maik

shubhamdubey
Mega Sage

Hi @Diane22 

 

I have reproduce your query in my PDI .

What i observed when i take manager field as string field which will give the sys_id as like you.

But i take manager field as a reference field it will give correct name .

 

So that conclusion is that we have to take same field data type like where it stored the data in our instance.

Like manager data type in user table in reference field so that if we want to achieve correct autopopulate feature we have to take manager field refernce field only .

 

I have attached the screenshot for your reference.

Manager details.PNGManager correct details.PNG

 

Sandeep Rajput
Tera Patron
Tera Patron

@Diane22 I am assuming that the data is populated on these fields using an onLoad/onChange client script. Since Service, Service owner and Managed by are reference fields, please check if you are assigning the correct sys_ids to these fields. If the sys_ids which you are populating do not belong to the table being referenced in the corresponding reference field then the sys_ids would be shown instead of the value of the display field.