- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I'd like to provide services through a portal screen.
I've discovered that the "g_scratchpad" I used on the platform cannot be used on the portal.
Is there an alternative storage option I can use?
Business Rules (Display Triggers)
↓
UI Policy
I'm currently implementing a "Business Rule (Display Trigger)" that saves complex decision results to "g_scratchpad."
The UI policy makes fields read-only based on the results of "g_scratchpad."
I'm looking to implement a server-side decision based on logged-in user information, and a UI policy that makes fields read-only based on that decision.
The server-side processing and UI policy processing are complete.
It works correctly on the platform.
It doesn't work on the portal.
I'd like to know how to pass values ​​from the server to the client side.
(I'd like to avoid using Ajax if possible.)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
if same logic you are thinking to implement on form widget in portal then I believe the only way is to use onLoad client script + GlideAjax
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @bonsai ,
In ServiceNow's Service Portal, the g_scratchpad object is not available. This limitation arises because the Service Portal employs AngularJS for rendering, whereas g_scratchpad is designed for the traditional UI framework. Consequently, to pass data from the server to the client in the Service Portal, alternative methods must be utilized such as data variables in widgets, GlideAjax for asynchronous server calls, and hidden form fields to pass data from the server to the client. The choice of method depends on the specific requirements of your application and the complexity of the data being handled
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You would like to avoid Ajax, but that doesn't seems to be an option here.
You will have to do ajax + client script or ajax + UI policies script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
if same logic you are thinking to implement on form widget in portal then I believe the only way is to use onLoad client script + GlideAjax
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @bonsai ,
In ServiceNow's Service Portal, the g_scratchpad object is not available. This limitation arises because the Service Portal employs AngularJS for rendering, whereas g_scratchpad is designed for the traditional UI framework. Consequently, to pass data from the server to the client in the Service Portal, alternative methods must be utilized such as data variables in widgets, GlideAjax for asynchronous server calls, and hidden form fields to pass data from the server to the client. The choice of method depends on the specific requirements of your application and the complexity of the data being handled
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You would like to avoid Ajax, but that doesn't seems to be an option here.
You will have to do ajax + client script or ajax + UI policies script