Service Catalog UI Policies Not Functioning in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 07:51 PM
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
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 08:15 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2016 06:38 AM
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:
(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:
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:
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2016 06:44 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2016 07:08 AM
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