Dot walking script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 10:10 AM
I need help writing a script with dot walking. I have a reference field on my form (Candidate) and i want my script to pull a field from that record (clearance type) and then set the value of a field on my current form to that. With the help of ChatGPT ive come up with this, but it appears to not be working. Can someone help me out please.
function onLoad() {
//Type appropriate comment here, and begin script below
var clearanceType = g_form.getReference('u_candidate').clearance;
alert(clearanceType);
g_form.setValue('u_req_clearance',clearanceType)
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 10:16 AM
@cpinedatx94 Please try the following.
function onLoad() {
//Type appropriate comment here, and begin script below
var clearanceType = g_form.getReference('u_candidate', getClearance);
function getClearance(clearanceType) {
g_form.setValue('u_req_clearance', clearanceType.clearance);
}
}
In case if the above script doesn't work then please share the technical names of your fields and a snapshot of the form if possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 10:33 AM
Still not working,
The reference field is "u_canadidate" which refers to the "Local technician table" I need it to pull the "Clearance" field value from the record and then set the value of "u_req_clearance" on the current form to the same as it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 10:17 AM
Hi @cpinedatx94 ,
Just check if Clearance Type variable name is "clearance" and alert is displaying the same.
function onLoad() {
//Type appropriate comment here, and begin script below
var clearanceType = g_form.getReference('u_candidate').clearance;
alert(clearanceType);
g_form.setValue('u_req_clearance',clearanceType); //added semi colon in last
}
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2023 10:36 AM
Its actually "Clearance" with a uppercase C. When i use that in the script the word "Clearance" turns blue. Which leads me to believe something is going on there. i know scripts are highly case sensitive but thats what it is on the form