We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Doucment_ID is not displaying value

dev_K
Tera Contributor

Hi,

 

 

I want to update the 'Applies to record' field so it corresponds the Department.

 
 

As you can see the Department has a name but Applies To Records = empty.

 
 

 

 

ph1.jpg

 

 

When looking at XML, however  these 2 fields have same sysID, so they should point to that specific Department Name.

 

 

Im using a script where I populate both fields with sysID but it only works for the department field.

 

 

How to proceed with this document_id type field so it shows the name of the record?

 

 

 

 

 

 

5 REPLIES 5

@dev_K 

so you need to set the source_table as well while setting sysId in document id field

-> create a source_table field of type Table Name and then use it in script

Make your Document ID field dependent on that Table Name field

See how it's done for syspproval_approver table

issueGR.setValue('refers_to_existing_table', true);
issueGR.setValue('applies_to', departmentSysId);

issueGR.setValue('source_table', 'cmn_department');

55.png

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader