Auto Populate Reference field based on another Reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 12:05 PM - edited 08-01-2024 12:08 PM
How can I auto populate a field value based on the value selected on another field? Basically, these are two different fields that are referencing the same table, so we want the value selected for field 1 to be auto populated in field 2.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 12:14 PM
@Austine You can create an onChange client script on field 1 and set the value of field 2 inside it. Here is an example
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('field_2',newValue); //Set the value of second field here
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 12:23 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 12:25 PM
@Austine Could you please share the names of these fields and why would you like to copy data of one field to another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 12:40 PM - edited 08-01-2024 12:51 PM
- @Sandeep Rajput, The field names are Select Location and Site. Once again, they are both referencing the same table. So, whatever users select in the SELECT LOCATION field should auto populate in SITE field.
Note: Site is a read-only field.
Thank you.