We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

UI Page HTML variable in gliderecord

DoDo labs___
Mega Sage

Hello


If I put the sys_id in the UI Page HTML script, the gliderecord works, but if I insert the variable, it doesn't.
I intentionally write out the value of the variable and it writes out the good sys_id.
Can anyone help?

 

 

<j:set var="jvar_pref" value="${sysparm_changeID}"/>
 
<p>${jvar_pref}</p>

<g:evaluate var="jvar_now_GR" object="true" jelly="true">
    var now_GR = new GlideRecord("checklist_item");
    now_GR.addQuery('checklist', ${jvar_pref});
    now_GR.query();
    now_GR;
</g:evaluate>
 
1 ACCEPTED SOLUTION

DoDo labs___
Mega Sage

I found the solution, it has to be put between apostrophes!

 

<j:set var="jvar_pref" value="${sysparm_changeID}"/>
 
<p>${jvar_pref}</p>

<g:evaluate var="jvar_now_GR" object="true" jelly="true">
    var now_GR = new GlideRecord("checklist_item");
    now_GR.addQuery('checklist', '${jvar_pref}');
    now_GR.query();
    now_GR;
</g:evaluate>

 

View solution in original post

1 REPLY 1

DoDo labs___
Mega Sage

I found the solution, it has to be put between apostrophes!

 

<j:set var="jvar_pref" value="${sysparm_changeID}"/>
 
<p>${jvar_pref}</p>

<g:evaluate var="jvar_now_GR" object="true" jelly="true">
    var now_GR = new GlideRecord("checklist_item");
    now_GR.addQuery('checklist', '${jvar_pref}');
    now_GR.query();
    now_GR;
</g:evaluate>