Populate fields based on another field value

VSN
Tera Expert

my requirement is to populate fields based on the  selecting reference field value.

I have few fields on the form like 1. employee type-(choices= new, old),

                                                          2. Employee name (reference)

                                                        3. employee number

                                                    4. employee manager

                                                  5. employee location.

 

For example : user select the employee type as Old and selecting one of the employee in the Employee name field based on that i need to populate all other fields like employee number, employee manager etc...

 

1 REPLY 1

Community Alums
Not applicable

Hi @VSN ,

You need to populate one field based on other field in service catalog, so you can use the catalog client script and glideajax

 

  • If you want to auto populate the value in another field on same form, you can use catalog client script.

var myVar = g_form.getValue('field-name1');

and set in another field using

g_form.setValue('field-name2',myVar );

 

  • If your business need to fetch value form the table you can use the callback function or use GlideAjax.

Refer this thread for GlideAjax example auto populate values based on another field value

 

Also, Please refer to thread : https://www.servicenow.com/community/itsm-forum/how-to-populate-multiple-choices-based-on-other-fiel...