- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 10:16 AM
I am trying to pass parameters from a UI Macro to a UI Page. The macro is a button that, when clicked, opens up a GlideDialog (that calls my UI page) on screen. I am trying to pass parameters to this modal popup.
I have successfully passed parameters to the Client Script side of the UI Page, but my issue is that I have been unable to access/save any parameters from the HTML/XML section of the UI Page. GlideModal is accessible from the <script> section, but 'GlideModal' is not defined when accessed via the <g:evaluate> or any other glide tags I have tried.
UI MACRO
var modal = new GlideModal(UI_Page, readOnly, width);
modal.setPreference('referenceField', 'myField');
modal.setPreference('inputBoxDefaultText', 'Keyword Search');
UI PAGE - Client Script
// successful access and use
var modal = GlideModal.get();
var referenceField = modal.getPreference('referenceField');
UI PAGE - HTML
// successful access of params, but have not figured out how to access this param via jelly/glide -> SEMI SUCCESS
<script>
var modal = GlideModal.get();
var test = modal.getPreference('inputBoxDefaultText');
</script>
// GlideModal is not defined -> FAIL
<g:evaluate>
var modal = GlideModal.get();
</g:evaluate>
// test variable created in script does not exist -> FAIL
<g:evaluate>
gs.log('My var ' + test);
</g:evaluate>
If I could figure out a way to access the script variables in the g:evaluate tags, that would be ideal. Anybody have any ideas/solutions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 10:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 10:23 AM
Hi Nick,
you can check below links:
How To Get Parameters/Values From a URL in ServiceNow | SN Commander
http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#gsc.tab=0
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 10:30 AM