How to use UI Scripts in Workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello,
what is best practise for using UI Script in Workspace as well as in the Calssic UI?
In article How to convert UI Scripts to run in Configurable Workspaces - The SN Nerd
the g_ui_scripts API is used to load the UI Scripts. That requires changes in Client Scripts and UI Scripts.
Is there any way to use UI Scripts in Workspaces without changing Client Scripts and UI Scripts?
(e.g. In the Service Portal it´s possbile to add UI Scripts to a sp_theme)
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
that's what UI scripts do.
UI scripts are meant to be called from client scripts or UI policies which run at client side.
UI scripts are not called from server side.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
yes, but if you want to call a UI Script from a Client Script in a Workspace, you need to load it with the g_ui_scripts API. That requires code adjustments in both, the Client Script and the UI Script.
E.g. in the Project Workspace you can view Project related records like pm_project or pm_project_task.
Existing Client Scripts on that tables can not load UI Scripts without adaptions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Yes, but that question was about the usage of UI Scripts in a Workspace.