- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 08:45 AM
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
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 10:09 AM
@cpinedatx94 Did you see any value in alert? Also, will it be possible for you to share the snapshot of the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 10:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 08:50 AM
@cpinedatx94 Try the following.
function onLoad() {
//Type appropriate comment here, and begin script below
var clearanceType = g_form.getReference('u_candidate').u_clearance_type;
alert(clearanceType);
g_form.setValue('u_req_clearance',clearanceType); //added semi colon in last
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 09:02 AM
Does it matter if the fields are choice fields? Both the u_clearance_type and u_required_clearance are both choice fields with the same values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 09:16 AM
Still not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 10:09 AM
@cpinedatx94 Did you see any value in alert? Also, will it be possible for you to share the snapshot of the form?