Can someone tell me when why my dotwalking script isnt working for my order form?

cpinedatx94
Tera Expert

I wrote this script from the help of chatGPT. The goal was to get the value of a field in a reference field by dot walking to it. (The reference field is "u_candidate" and the field i want to grab from inside it is called Clearance[u_clearance_type]). 

 

I then wanted to take the value and set the value of a current field on my current form to it. Here is my script. It does not appear to be working. Any help would be much appreciated.

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   var clearanceType = g_form.getReference('u_candidate').Clearance;
         alert(clearanceType.getValue());
         g_form.setValue('u_req_clearance',clearanceType);  //added semi colon in last
}
2 ACCEPTED SOLUTIONS

@cpinedatx94 Did you see any value in alert? Also, will it be possible for you to share the snapshot of the form?

View solution in original post

5 REPLIES 5

The alert is showing a value "Undefined"