Set Default Value to field from Reference

jenn123
Kilo Contributor

Is there a way to set the default value to a dot walked field of a reference field on the same table? See example below on the Change Order table. Would like to set the "Requested for" default value to be the business contact which comes from the Project itself (referenced in Project Number). Is there any way to do this?

find_real_file.png

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hmm...If it's not working this way I would try it in a before insert business rule instead.



current.u_requested_for = current.u_project.u_business_contact;


View solution in original post

11 REPLIES 11

jenn123
Kilo Contributor

Hi Emily,



Thanks for the suggestion. Unfortunately it didn't seem to work for me


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Jennifer,



Have you validated that u_project and u_business_contact are the correct field names? Also, is u_business_contact a reference field to the user table? I would not do this through a client script.


Yes, those are the correct field names. And yes, u_business_contact is a reference field to the user table, so is the Requested For field.


Brad Tilton
ServiceNow Employee
ServiceNow Employee

How is the u_project field getting populated on the record? If that field is not yet populated when the record is created then we may not be able to use a default value.


It's being populated automatically to be whatever project is open when you click "New" from the Change Orders related list (which is on the Project form) - not sure if that answers your question? Thanks again for your help!