How to populate one field value based on other field value in Service Catalog ?

Dinesh9
Giga Contributor

Hi All,

I need to populate one field based on other field in service catalog. Please let me know the solution.

 

Thanks,

Dinesh Kumar G

5 REPLIES 5

Sagar Pagar
Tera Patron

Hello Dinesh,

 

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

 

 

 

Hope this will help you.

Regards,

Sagar Pagar

The world works with ServiceNow

Hi sagar, 

Your solution is for 1:1 mapping. But I have two fields say 'class' AND 'CI' .  i want to populate multiple values in ci based on the choice selected in class and ci is having bulks of records say (1000000) . please let me know how to do it.

 

Thanks,

Dinesh Kumar G

Hello Sagar,

 I have one problem statement, populate one field on another field ex; in (incident table ) Number field data  will populate on the incident Number field, I have use only one business rule on more than 5 tables

like 1.table- incident-  (field ) number -populate on- incident number field

      2 table- problem - (field) number  -populate on- problem number field, etc how can I do?

I am a beginner please let me know the solution .

 

Onkar Pandav
Tera Guru

Hi,

Please see the below thread. I have given the answer.

https://community.servicenow.com/community?id=community_question&sys_id=43ba3e80db9f4490feb1a851ca96...

Check it & let me know.

--

Thanks

Onkar