How to display the condition variable on specific task

sasipriya
Tera Contributor

Hi Team,

 

   Can anyone please help me on below requirement.

 

I have one requirement .I should display one variable on a specific catalog task. Currently, I have 4 SC tasks for that catalog item. If I select a variable value of No, then variable should be visible only on the 3rd task and not in other tasks, which means if I select No in other tasks, this variable shouldn't be visible.

 

Thanks,

Sasipriya.

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@sasipriya 

you should use normal onLoad client script on sc_task table and check the variable value and short_description of catalog task and then show/hide

function onLoad(){

	var variableValue = g_form.getValue('variables.variableName');

	g_form.setDisplay('variables.variableName', false);

	if(variableValue == 'no' && g_form.getValue('short_description') == 'short description of 3rd task'){
		// show the variable

		g_form.setDisplay('variables.variableName', true);
	}

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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