I have a requirement whenever i click the checkbox the list collector value should be populate

sakila
Tera Contributor

I have a requirement whenever i click the checkbox the list collector value should be populate automatically when created RITM . 

Question form level hiding the value data warehouse . it will displayed only once create RITM .

for example if an tick the checkbox as Develpoment, after submitting RITM data warehouse value should populate automatically

any one can help  

 

sakila_0-1722488392795.png

 

 

3 REPLIES 3

SN_Learn
Kilo Patron
Kilo Patron

Hi @sakila  ,

 

Please try the below onChange Client Script:

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

if (newValue == 'true') {
var wareList = ['4ae3ab0753101200ed11da86a11c0881,3f0370019f22120047a2d126c42e705e'];
g_form.setValue('data_warehouse’, wareList.join(','));

}
else {
g_form.clearValue('data_warehouse’);
}
}

 

SysId(s) will be of 'Data warehouse Grant access..' selected options.

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

this is onchange , but i need after submitting RITM , the list collector value should be auto populate

 

Hi @sakila  ,

 

Try the GlideAjax approach to achieve this in onSubmit Client Script:

 

https://www.servicenow.com/community/developer-forum/populate-usernames-in-to-a-list-collector/m-p/2... 

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.