Looping through an array in JellyScript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 11:44 PM
Hi all,
I have a single dimension array that was populated in the <g2> tag in UI Page. In the same page, I wanted to loop through this array in the jelly tag to populate a table in HTML. Does anyone knows how to do this? The code I had in <g2> tag is as followed and needs to be converted to jellyscript for the looping:
for (var i = 0; i < assignedIdList.length; i++) {
gs.print(assignedIdList[i]);
}
Your help is appreciated.
Thank you.
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2015 06:50 PM
You need to refer to jvar_color as follows:
<td>${jvar_color}</td>
<td>${jvar_color.name}</td>
<td>${jvar_color.value}</td>
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022