The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Service Catalog UI Policies Not Functioning in Service Portal

Marques2
Tera Expert

Helsinki and Service Portal Users,

It's extremely disappointing to see that simple UI policies in the Service Catalog are not functioning as expected in the Service Portal. The UI Policy Actions I'm using are to simply make variables visible and mandatory when the condition of another variable is met.

I found another thread that was similar to mine and someone explained that the fix is to set a condition that states "Run scripts in UI type" is "Both". Unfortunately this did not fix the issue. Are others experiencing this? If so, is there a solution?

We've built many catalog items with dependent variables and they are not functioning in the Service Portal. This can push our Go Live date back if a solution cannot be found. Please reach out if you have any ideas!

Any help is appreciated,


Thank you all!

-Marques

8 REPLIES 8

Brad Tilton
ServiceNow Employee
ServiceNow Employee

UI Policies should work in Service Portal as long as you have Both selected in run scripts in ui type, which it looks like you have. Are all of your ui policies not running or specific ones, and are you doing anything in the script fields?


Hey Brad,



Maybe this issue is with my client scripts and not UI policies. Let me share some info- In the form I have 12 containers. 3 containers are "grouped" together so there's 4 sets. onLoad, the first set of containers are visible and collapsed as such:


find_real_file.png


(Yes, this is a virtual server request form- we are not yet integrated with VMware...soon hopefully)



In the container "Application Security Questions- Server 1" there's a question asking if additional servers are needed and if answered yes, the next set of containers display. The visibility of these containers comes from the UI policies in place, as well as making the fields mandatory in the next 3 containers. Here's what that looks like:



find_real_file.png



In the Service Portal, the containers are not collapsed onLoad. I unfortunately completed the collapsing using sys_ids and following this thread: https://community.servicenow.com/thread/220129?q=collapse%20containers


I know I shouldn't be using sys_ids to do this but I didn't know of another way how. So maybe that's my issue and it's not the UI policies. The UI policies are setup to show the collapsed variables dependent on the need of another server.



Here's what my script looks like for the onLoad client script of the collapsed containers:


find_real_file.png



If you have any input, please let me know. I'm really hoping I can get the same functionality working in the Service Portal as it does in the Native UI.



-Marques


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Ahh ok. Service Portal only supports a subset of the client side methods available in ServiceNow, and unfortunately toggleVariableContainer() is not a supported method. The following link will tell you which methods are supported.



documentation/client_scripting.md at master · service-portal/documentation · GitHub


That's a bummer- Thanks for the quick follow up again. Any suggestions how I can accomplish this both in the Service Catalog and Service Portal? I don't think I have other areas that I'm toggling containers.



Let me know if you have any ideas!



Thanks again, Brad



-Marques