Jelly script - For loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2015 06:52 AM
Hi,
How can we write the following code in a UI macro?
Need it outside the g:evaluate tag.
for (key in current.variables)
{
var v = gcurrent.variables[key];
gs.log(v.getGlideObject().getQuestion().getLabel());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2015 12:50 PM
Does this work?
<script>
<j2:forEach var="jvar_key" items="$[current.variables]">
var v = gcurrent.variables[jvar_key];
gs.log(v.getGlideObject().getQuestion().getLabel());
</j2:forEach>
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2015 01:37 AM
Use this
<j2:forEach var="jvar_upd" items="$[jvar_updates]">
<br/>$[jvar_upd]
</j2:forEach>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2015 01:41 AM
Thank you guys,
i found the way, your inputs were valuable