populate current user

rajachodisetti
Tera Contributor

Hi All,

I have a requirement where I have created multiple variables - RequestedFor, MobileNumber, Email, Preffered contact method,Type of Request ,role etc

1.user opens the form above details auto populate with logged in user
2.on change of user, above details to be changed auto change based on the user change

  • Current logged in user value should be default in Requested for variable.
  • Email and phone numbers should be auto populate from user table based on the values selected in ‘Requested for’ variable.
  • Preferred Contact Method default value should be IM



Please help me to achieve this requirement

 

Thanks&Regards,

Raja

2 REPLIES 2

Vigneshwar Redd
Tera Expert

Hi,

You can follow below steps to auto populate the Requested For details with logged in User.

  1. Navigate and open the variable which you need to auto-populate
  2. In the variable declaration there is a tab labeled 'Default Value'
  3. Set the default value to javascript:gs.getUserID();
  4. Save the record.

    Also to populate the user details you need to write a onchange client script and pull the details from the requested For.


    Hope this Helps..!!!

    Thanks

Adrian Ubeda
Mega Sage
Mega Sage

Hi rajachodisetti, 

 

In your field that is a reference of sys_user table, add as a default value 'javascript: gs.getUserID()'. This will get the current user, then the other variables can be auto-populated from dictionary definition as follows:

AdrianUbeda_0-1680097421609.png

With this the value will be automatically updated without any scripting.
For contact media field use the same as first one, default value 'string_value' and will be automatically selected.

 
If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆