- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 05:35 AM
I'm facing an issue where I need to pass data from a UI Page Client Script to a Workspace Client Script callback function, i referred community articles but this wasn't helpful.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 07:37 AM
did you explore few of the OOTB UI actions?
somewhere the logic must be present.
you can use callback method, I believe ServiceNow uses iframeMsgHelper for this
Search with UI page client script contains -> iframeMsgHelper
UI page client script using that and including the data to be passed
Then in workspace client script, it's accessed like this
OOTB UI page: time_sheet_recall_dialogue
OOTB UI action: Recall (time_card) table
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
08-05-2025 07:21 AM
Workspace UI Action can open a UI Page as a modal using g_modal.showFrame(). Within that iframe, your UI Page uses iframeMsgHelper (or window.postMessage) to send data back to the parent workspace modal. Use a Workspace UI Action with a Client Script (client-side, enabled) to call your UI Page. The callback function defined in the Workspace client script receives that data and processes.
Try this once and let me know. If you find this helpful, please accept this as a solution and hit the helpful button..
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
08-05-2025 07:37 AM
did you explore few of the OOTB UI actions?
somewhere the logic must be present.
you can use callback method, I believe ServiceNow uses iframeMsgHelper for this
Search with UI page client script contains -> iframeMsgHelper
UI page client script using that and including the data to be passed
Then in workspace client script, it's accessed like this
OOTB UI page: time_sheet_recall_dialogue
OOTB UI action: Recall (time_card) table
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
08-05-2025 08:58 PM
Hope you are doing good.
Did my reply answer your question?
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
08-06-2025 05:25 AM
In my case, the functionality works correctly in Native UI, but in Workspace, I'm unable to retrieve the values as expected.
My requirement is: when a modal opens, it displays some fields. Based on the data entered in those fields, a GlideAjax call is triggered to create a record and return the sys_id and i set it to one field using g_form.setValue().
While the sys_id is successfully returned in Workspace, I'm unable to retrieve or use it properly within the Workspace client script. I’ve tried using iFrameHelper and postMessage, but those approaches didn’t work.