Catalog UI Policy Script

oww15
Tera Contributor

Hello everyone!

 

Can someone help me with the catalog UI policy script? I need to show the download link field if the product field is not VPN. However, the product field is populated through a client script. How can I make a script for this one? Thanks!

 

12 REPLIES 12

-O-
Kilo Patron
Kilo Patron

Why do you need to script this?

Just add the UI Policy action that sets the app. req. template field's visibility.

oww15
Tera Contributor

Because the visibility of the app.req field is dependent on the product field which value comes from the client script.

I realized in the mean time that the problem is that you are conditioning the visibility upon a variable which cannot be selected in the condition builder.

You can refer to variable in Client Script as below:

 

g_sc_form.getValue('<variable name>')
g_form.getValue('variables.<variable name>')

 

current is something that only exists server side (that is in ServiceNow's web server).

Client Scripts (Catalog Client Scripts too) exist client side (in the browser).

So correcting the current bit should get you closed to what you want.

Though for proper debugging and answer, it would be helpful to clarify if this is a Catalog Item, or a Record Producer and what is the target table in the latter case.