Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

how to use for and while loop in jelly tag?

ranadip1
Kilo Explorer

i want to use this for loop inside a jelly tag.......

<g:evaluate>

var counter=12;

var   PageCount=50

 

</g:evaluate>

 

<j:while test="${counter lt; PageCount}">

 

..................................................

 

 

this is not working...... any idea??

1 REPLY 1

mike_allgire
Giga Guru

What are you looping through? Is this script complete? In order to loop, you need to have something to loop through and not just a static number. Is your while test supposed to be an "and" statement? If so, you should be using &amp;&amp; instead of lt;. The other issues I see is a missing semicolon on your PageCount javascript.



I can try to help with more information if needed; however the following pages are extremely helpful.


Jelly Tags - ServiceNow Wiki


Extensions to Jelly Syntax - ServiceNow Wiki


TechNow Episode 1 | ServiceNow Jelly Scripting Part 1 of 3 - YouTube