- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 11:48 AM
On a UI Page, I'm running two Glide queries (against sys_user and a custom table) and storing the results into an array. After that, I'm taking the two arrays, finding the difference between the two using ArrayUtil() and then trying to display the difference out on a UI Page. That's where I'm running into an issue. When I display the results I want (the difference), I simply get 'null' for each returned value. One thing to note is, the custom_table.u_name field referenced in the code below is a reference to sys_user.
<g:evaluate var="jvar_resultsarray">
var donearray = [];
done = new GlideRecord('custom_table');
done.query();
while(done.next()){
donearray.push(done.u_name.toString());
}
donearray;
var outstandingarray = [];
var notdone = new GlideRecord('sys_user');
var queryNotDone = 'department=674a86516ffe9900ef9c164e5d3ee4b1^active=true';
notdone.addEncodedQuery(queryNotDone);
notdone.query();
while(notdone.next()){
outstandingarray.push(notdone.middle_name.toString());
}
outstandingarray;
diffArray = new ArrayUtil().diff(outstandingarray,donearray);
diffArray;
</g:evaluate>
<!--display array-->
div>
<j:forEach var ="jvar_array" items="${diffArray}" indexVar="jvar_i">
<g:evaluate var="jvar_s" expression="jvar_array[${jvar_i}]" />
${jvar_s}<br/>
</j:forEach>
</div>
From what I can tell, the above works (definitely works in a background script when you strip the glide/jelly tags). But again, displaying it out on a UI Page results in a bunch of nulls. I built what I have using suggestions from How to retrieve element from array in a jelly tag, but can't seem to get any further on my own.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 12:31 PM
Have you tried the following for lines 29-32?
<j:forEach var ="jvar_array" items="${diffArray}">
${jvar_array}<br/>
</j:forEach>
If you still get null, what happens when you log out the array in line 22 with:
JSUtil.logObject(diffArray);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 12:31 PM
Have you tried the following for lines 29-32?
<j:forEach var ="jvar_array" items="${diffArray}">
${jvar_array}<br/>
</j:forEach>
If you still get null, what happens when you log out the array in line 22 with:
JSUtil.logObject(diffArray);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2015 02:42 PM
Using your suggestion for lines 29-32 did the trick. Looks like I overcomplicated things from the beginning.
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 07:02 AM