onChange Client Script for changing dot walk field

John91
Tera Contributor

Hi,


I created new custom table and added two reference fields.
In Incident view, these fields are added as dot walk.

 

Then I created onChange client script for the custom table but this didn't work for Incident view.

 

Secondly, I tried to create onChange client script for Incident table, but of course, I couldn't set dot walk field.

John91_3-1689754304054.png


Is there any way to set dot walk fields to onChange target field (Field name)?

If you need more detail for answer, please tell me.
Thanks!

8 REPLIES 8

Dan O Connor
ServiceNow Employee
ServiceNow Employee

@John91 You can generally dot walk from many places. Might be helpful to share the OnChange script you are referencing here, and a short outline of what the purpose of it is. What are you trying to achieve? 

Hi @Dan O Connor 
It may not be proper word "dot walk" for this case, but I want to create onChange client script of table A fields which works in the view of table B. 
This cause is not its script because it doesn't work inspite of the script is only for addInfoMessage as a test.


The root purpose is to automatically set the group reference field of table A by manually setting the user reference field of table A in the view of table B.
So I need the onChange interaction of two fields of table A in the view of table B.

John91_0-1689831758828.png

 

Dan O Connor
ServiceNow Employee
ServiceNow Employee

Ah ok so you want to autopopulate the group, based on the user that is selected. The view won't really matter for the script. You could do this through a number of ways and is a pretty common request. If you search the community form you will find hundreds of examples.

 

Alternatively if you want to post your script here we can have a look and figure out why its not working 

Hi @Dan O Connor 
Precisely speaking, it's not just to autopopulate the group.
The group and user fields belong to A table (custom table) but I want to set a value to the user fields from a form of B table (Incident).
Generally autopopulation works by using onChange client script, but when it comes to the manipulation from the different table form, it doesn't work.
I don't know the cause and I couldn't find any community form for the answer.
If you've found the correct answer form on the community, please tell me.