- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 10:51 AM
Dear Expert,
How can I proceed with this requirement? Once the user field name is entered, the email field should automatically populate. Please help Thank you so much. Appreciate your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:34 AM
did you try putting alerts ?
make sure your back end names of variables are correct
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var user = g_form.getReference('name', userDetails);
function userDetails(user) {
alert(user.email);
g_form.setValue('email', user.email);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:53 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 12:12 PM
Hello, assuming you are doing this on a table, using a business rule to do this would be very simple. For your table that your two fields live on, you can create a business rule to set the value of email when a user is picked in your reference field.
Example:
Let me know if you're trying to do this on a catalog item through the service portal instead and I can help with that too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 09:41 AM
var user = g_form.getReference('field_name', function(user))
{
g_form.setValue('field_name', user.email.toString())
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 11:53 AM
Hello,
can you share the script with which you tried to auto populate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 01:24 PM
on the form, I would like to type Name and email to be filled in automatically.
but onChange did not work.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var user = g_form.getreference('name', function(user) {// map the correct field
g_form.setValue('email', user.email.toString());// map the correct field
});
please help 😞
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 01:28 PM