- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â12-24-2020 02:01 AM
In a ui page , how can I access variables inside <g2:evaluate> in client script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â12-27-2020 09:58 PM
you need to convert that to string
<g2:evaluate var="jvar_gr" object="true" jelly="true">
var sysparm_original = RP.getParameterValue('sysparm_original');
var sysparm_template_sysid = RP.getParameterValue('sysparm_template');
var arr = [];
var gr = new GlideRecord('sn_doc_html_template');
gr.addQuery("sys_id",sysparm_template_sysid);
gr.query();
if(gr.next())
{
gs.addInfoMessage(gr.name);
arr.push(gr.name.toString());
arr.push(gr.footnote.toString());
arr.push(gr.html_script_body.toString());
}
arr.toString();
</g2:evaluate>
Regards
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
â02-21-2022 02:48 AM
Pay attention! Without copyToPhase2="true" attribute it will not work!
I mean
<g2:evaluate var="jvar_gr" object="true" jelly="true" copyToPhase2="true">
Tested in ROME release
Also it may be helpful for all of us: ServiceNow UI Developer cheat sheet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-21-2022 03:00 AM
Sorry didn't get you. Can you explain in detail?
Are you saying to make it work in ROME this attribute is required
copyToPhase2="true
Regards
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
â02-21-2022 03:10 AM
At least in ROME it works only with copyToPhase2="true" attribute
Could you test it on your instance and edit your answer in the Accepted Solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-21-2022 03:15 AM
We cannot edit response which is marked as correct.
But since you have mentioned the solution for Rome version; person searching for the solution will apply that.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-21-2022 03:23 AM
Ok, thank you!