How does the expression works in jelly code g2:evaluate tag?

Indira Priya Da
Tera Guru

Hello Team,

We have html block of Jelly code to display attachments with checkbox on UI page. Please help me to understand, why Attachment_ has used in the expression of evaluate tag..


<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/>
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>

code snippet for reference:

Code is trying to check/uncheck checkbox based on the flag value set on sys_attachment (att) table. except the given lines, no where I found the reference of Attachment_ on UI page.

Thanks & Regards,

Indira Priya Darsini M.

1 ACCEPTED SOLUTION

DScroggins
Kilo Sage

Hi,

The <g2: evaluate> jelly tag sets the value of declared variables. So for the following lines:

<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/> 
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>

That is setting the variable 'jvar_name' to equal Attachment_' + att.sys_id & it is setting the variable 'jvar_x' to the preference value returned by gs.getPreference('Attachment_' + att.flag)

View solution in original post

1 REPLY 1

DScroggins
Kilo Sage

Hi,

The <g2: evaluate> jelly tag sets the value of declared variables. So for the following lines:

<g2:evaluate var="jvar_name" expression="'Attachment_' + att.sys_id"/> 
<g2:evaluate var="jvar_x" expression="gs.getPreference('Attachment_' + att.flag)"/>

That is setting the variable 'jvar_name' to equal Attachment_' + att.sys_id & it is setting the variable 'jvar_x' to the preference value returned by gs.getPreference('Attachment_' + att.flag)