want to show instructions on cat item based on condition using 'custom' type variable and UI macro

GD11
Tera Expert

I have a requirement where i want to show instructions with some link on catalog item based on choice selected in previous variable in catalog item. i have created a variable with type = custom and created UI macro and UI policy show the variable but it is not woking, please help.

GD11_1-1743074023160.png

 

GD11_0-1743073951277.png

 

GD11_0-1743075236864.png

 

GD11_2-1743075324838.png

 

 

GD11_3-1743074104944.png

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

@GD11 

then why not do this

1) create a widget and add the link there, hide that by default when widget loads

2) create a variable of type Custom and add the above widget there

3) then detect change of variable in your widget, once you get the value in widget show/hide the link

this link should help you

Widget that reacts to onChange event of Variable 

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@GD11 

it's not possible to show/hide variable of type Custom using UI policy or client script

why not show a form message with link using g_form.addInfoMessage() based on change of that variable?

are you only intending to use platform and not portal for your catalog item?

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

@GD11 

Hope you are doing good.

Did my reply answer your question?

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

@Ankur Bawiskar  we are going to use portal for this requirement.

@GD11 

then why not do this

1) create a widget and add the link there, hide that by default when widget loads

2) create a variable of type Custom and add the above widget there

3) then detect change of variable in your widget, once you get the value in widget show/hide the link

this link should help you

Widget that reacts to onChange event of Variable 

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