Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Jelly Script not printing output

venkatsaladi
Tera Contributor

Hello Community, I started learning jelly script for building UI pages and I was strucked at the begining, can you provide help why the below code is not working correctly, although I wrote correctly.  hardware variable is not printing

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null">
<j2:set var="hardware" value="keyboard"/>
<p>${hardware} is out of stock currently</p>
</j:jelly>

 image.png

1 ACCEPTED SOLUTION

RaghavSh
Mega Patron

Try below:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null">
<j:set var="jvar_hardware" value="keyboard"/>
<p>${jvar_hardware} is out of stock currently</p>
</j:jelly>

 


Raghav
MVP 2023
LinkedIn

View solution in original post

4 REPLIES 4

GlideFather
Tera Patron

Hi @venkatsaladi 

 

try to remove the "2" in:

<j2:set var="hardware" value="keyboard"/>

to be:

<j:set var="hardware" value="keyboard"/>

 

Let me know whether it helped

_____
This reply is 100 % GlideFather and 0 % AI

@GlideFather I tried still not working

 

RaghavSh
Mega Patron

Try below:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null">
<j:set var="jvar_hardware" value="keyboard"/>
<p>${jvar_hardware} is out of stock currently</p>
</j:jelly>

 


Raghav
MVP 2023
LinkedIn

@RaghavSh your solution is working, but could you please tell me why you used "jvar_"?