A variable set variables should be Visible only on RITM and task.

Community Alums
Not applicable

Hi community,

I am working on service catalog. after submitting the service request I want to display the variables set only on (variable editor) RITM and TASK. If I'm making use of catalog_ui_policy the variables is also visible on catalog form and portal, which i should not be in my scenario.

 Requirement is : based on condition it should populate variables sets on ritm and task table. 

I have set Applies on Catalog Tasks- marked as false but still not working.

Regards and Thanks,

Rafmine.

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

check these points

1) Create onLoad Catalog Client Script

2) Applies to --> Catalog Item and select the catalog item name instead of Variable set name

3) Ensure you set Applies to Catalog Task - True and Applies to Requested Item - True

function onLoad(){

//Replace 'VARIABLE_SET_NAME' with the name of your variable set.

g_form.setDisplay('VARIABLE_SET_NAME',false);

}

Regards
Ankur

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

Community Alums
Not applicable

Hi Ankur,

Thank you for showing interest answering my post..

I tried this script but my bad....need you help to understand where am going wrong.

 

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

var actionreq = g_form.getValue("action_required");

if(actionreq == "install"){
g_form.setDisplay("hw_7_questions_vs",true);

}
else if(actionreq == "remove"){
g_form.setDisplay("hw_7_questions_vs",false);

}
}

 

Regards,

Rafmine.

@Rafmine 

Did you set UI Type- ALL

please share your client script screenshot

Regards
Ankur

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

Yash Agrawal1
Tera Guru

Hello User,

You can very  easily do it,via UI Policy,

Please create a UI POLICY,to make the variable/variabl set visible

And Besure to check

Applies on RITM and Applies on CATALOG TASK.

also

Uncheck Applies on Catalog item view.

So that the ui policy make the variable visible only on ritm and task and not on CATALOG ITEM AND PORTAL.

If you like the solution provided.then please mark it as CORRECT AND HELPFUL.

Regard

Yash Agrawal