- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 01:59 PM
Is there any way to show the value of an HTML field properly when it's delivered in a pop-up that shows a UI page?
Right now any HTML comes across as regular text and isn't translated in the XML of the UI Page.
See here for reference: https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/client_scripts/reference/r...
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 03:44 PM
Hi Shane,
Here's an example of how you can get the values using client script in a UI Page Preview and set the values in the page content.
In the above script, in the Client script section, you'll see that GlideForm,i.e., g_form methods are used to access the value of "short_description". I have included comments to give you an idea of the purpose of those statements.
The values accessed using g_form methods are then set in the UI Page content using DOM Methods (it is not going to get impacted by any upgrade as it is your own HTML code, which is not going to change its document structure).
So, here is the incident form where I tried previewing the UI Page:
And here is the preview result using the UI Page:
This implementation got the results from the client side of the form, not the server side. So you'll get the current values even if they're not yet saved.
Hope this helps!
Cheers,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2019 05:02 PM
There is also $[SP]
<b>Reason alt:</b>$[SP]<g:no_escape>${rec.u_body}</g:no_escape>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 05:29 AM
Manish you should write up a blog on how to create a Preview UI Action. 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 03:16 PM
Haha, if there are no similar blogs / articles, then yeah maybe 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 06:38 AM
Can you explain this more:
Regarding your first issue:
If you want to get details from client side you can trigger glideform methods on the client script part of the UI Page or maybe within a script tag in the UI Page, which is set to execute on load. You can define "ID" on each HTML element where you want to update the content, then can use javascript functions to set those values. This will happen after the UI Page has rendered, i.e. <g:evaluate> has already been processed. So you can choose to update those values only if there is a change in the values which were fetched from Server side.
I can't find any examples of how to call a variable from the Client Script - everything refers to using 'input' fields, which I have no interest in for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 03:44 PM
Hi Shane,
Here's an example of how you can get the values using client script in a UI Page Preview and set the values in the page content.
In the above script, in the Client script section, you'll see that GlideForm,i.e., g_form methods are used to access the value of "short_description". I have included comments to give you an idea of the purpose of those statements.
The values accessed using g_form methods are then set in the UI Page content using DOM Methods (it is not going to get impacted by any upgrade as it is your own HTML code, which is not going to change its document structure).
So, here is the incident form where I tried previewing the UI Page:
And here is the preview result using the UI Page:
This implementation got the results from the client side of the form, not the server side. So you'll get the current values even if they're not yet saved.
Hope this helps!
Cheers,
Manish