Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

What is .Dot Walking and how to configure it for incident table

Srinivas snow28
Tera Contributor

What is .Dot Walking and how to configure it for incident table.

 

Scenario : Based on caller selection auto populate email Address

4 REPLIES 4

Community Alums
Not applicable

Hi @Srinivas snow28 ,

Dot-walking allows direct scripting access to fields and field values on related records. For example, the NeedIt table has a reference field called Requested for. The Requested for field references records from the User [sys_user] table. Reference fields contain the sys_id of the record from the related table.

 

Now for your requirement, refer to this sample code using Onchange Client script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading) {
   g_form.setValue('requested_for',g_user.userID);//add this
return;
    }
    if (newValue == '') { // if user empty then make dependent fields empty as well
        g_form.setValue('phone_no', '');
        g_form.setValue('email', '');
    }
   var user= g_form.getReference('requested_for', populateOtherFields); // provide user field name correctly

    function populateOtherFields(user) {
        g_form.setValue('phone_no', user.phone);
        g_form.setValue('email', user.email);
    }


}

  

Sandeep Rajput
Tera Patron
Tera Patron

@Srinivas snow28 If you are referring to adding dot walked fields on the incident form then using following steps you can do it.

1. Configure the form layout

Screenshot 2024-10-18 at 9.36.43 AM.png

2. Scroll to the caller field and click on reference icon to expand the reference field

Screenshot 2024-10-18 at 9.38.11 AM.png

Choose Email field from the caller fields

Screenshot 2024-10-18 at 9.58.13 AM.pngScreenshot 2024-10-18 at 9.58.33 AM.png

Add it to the form layout

Screenshot 2024-10-18 at 9.59.02 AM.pngScreenshot 2024-10-18 at 9.59.26 AM.png

 

Hope this helps.

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Srinivas snow28 

 

Dot walk means, when you called the field of another table in required table. Like you said, caller is Reference field on Incident table, which come from sys_user table. 

 

To configure it

in form Layout

Select Caller 

then expand that

and select email which will show like caller.emailid

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

AndersBGS
Tera Patron
Tera Patron

Hi @Srinivas snow28 ,

 

 DOT walking is when you walk by reference fields between tables. E.g. from incident to use table. To get email auto populated you can utilize a client script based on the caller.

 

If my answer has helped with your question,  please mark my answer as accepted solution and give a thumb up.

 

 Best regards

 Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/