How can I auto populate email field, when user field filled.

ND7
Kilo Sage

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. 

find_real_file.png

2 ACCEPTED SOLUTIONS

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);
    }
}

View solution in original post

Thank you Ankur, I will try this Catalog lookup for sure. BEST

 

View solution in original post

20 REPLIES 20

Raj_Esh
Kilo Sage
Kilo Sage

Hi ND,

 

You will have to create a Script include and Client script.

 

Follow the below URL for understanding and achieving your requirement. 

 

How to call script include from client script

 

Hope it helps.

 

Thanks,

Raj

--Raj

Thank you, Raj, however, I just only need to auto-fill for one form, your example looks like this will be a global change. 

Yousaf
Giga Sage

Hi,

Did you try using business rule for that?

You can do that using onChange Client script too.

How to Auto Populate email id of user in email field whose name is specified in Requested For field ...


Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

i tried but did not work 😞