Auto populate the fields data if selected yes option in catalog item

k niranjan das
Tera Contributor

Hi everyone ,

i need to auto populate the fields in the portal if i selected the yes/no option it should be generate the data in the fields

example: Do you need to apply dropdown is yes or no?

6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@k niranjan das You need to use an onChange Client script applied on your Yes/No filed. Inside your client script you can call a client callable script include using GlideAjax.

 

For more information on Client script please refer to https://docs.servicenow.com/en-US/bundle/vancouver-application-development/page/script/client-script...

 

For more information on script include, please refer to https://docs.servicenow.com/en-US/bundle/vancouver-api-reference/page/app-store/dev_portal/API_refer...

 

Hope this helps.

Utpal Dutta
Tera Guru

Hi Niranjan,

If you want to populate data on catalog item in portal then you should you catalog client script for this. You can create an onChange catalog client script which will run on change of yes/no field and then with help of GlideAjax & script include  you can get the values from server and populate in the variable of catalog item.

You can read more GlideAjax here.

 

If my answer helps then please mark it correct.

 

Thanks,

Utpal

Ankur Bawiskar
Tera Patron
Tera Patron

@k niranjan das 

unless you share script and screenshots we cannot help.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

function onLoad() {
   if(g_form.getValue('do_you_own_apply') =='yes'){
    alert('do_you_own_apply');
    g_form.setDisplay('account_details', true);
   }
}