Have you tested your solution?
I placed your suggestion in my code snippet and it's not working.
Find the list of errors it's showing in the log:

iva25_0-1750502592988.png

Another thing the UI action is client callable so current.sys_id will not work so I used this:

var sysId = g_form.getUniqueValue();
	dialog.setPreference('cab_meeting_sys_id', sysId);
    dialog.setPreference('sendToNew',  sendNotificationsToNewAttendees.bind(this, dialog));
    dialog.setPreference('sendToAll',  sendNotificationsToAll.bind(this, dialog));
	dialog.render();

This gives the sys_id I checked in the alert. 

The main problem is linking the UI action variable to the jelly. I already tried by using the setPreference and access that in the Jelly It didn't work. Another thing is that do you think g:evaluate can give two variables as a output?

<g:evaluate var="cabMeetingId" expression="jvar_cab_meeting_sys_id" />

    <g:evaluate>
        var attendees = [];
        var attendeesid = [];

        var cbgr = new GlideRecord('cab_attendee');
        cbgr.addQuery('cab_meeting', cabMeetingId);
        cbgr.query();

        while(cbgr.next()){
        attendees.push(cbgr.attendee.getDisplayValue());
        attendeesid.push(cbgr.attendee.toString());
        }

        var attendeesString = attendees.join(',');
        var attendeesSysIds = attendeesid.join(',');
    </g:evaluate>
    <!-- Use sys_ids to prefill list collector -->
    <g:macro_invoke macro="lightweight_glide_list" name="attendee_list" reference="sys_user" can_write="true" value="${attendeesSysIds}" />

    <!-- Displaying Attendees as List -->
    <table style="margin:20px 10px;">
        <tr>
            <td colspan="2"><strong>List of Attendees</strong></td>
        </tr>
        <tr>
            <td colspan="2">
                <ul>
                    <!-- Loop through the comma-separated list and display each one as a list item -->
                    <j:forEach var="jvar_attendee" items="${attendeesString.split(',')}">
                        <li>${jvar_attendee}</li>
                    </j:forEach>
                </ul>
            </td>
        </tr>
    </table>


Output after updating the suggested code:

iva25_1-1750503076682.png

 

 

Do you have any idea How to define the process script and from there how to use the variables that holds the output in the jelly script.

Thank You for your time and effort and providing the suggestions.

Hi @aviavillan ,

I hope this solution will work for you

 

Instead of hardcoding the CAB Meeting ID in your Jelly script, replace this line:

cbgr.addEncodedQuery("cab_meeting=ddb4a4ef5ca712104f3496f8659cf639");

With this at the top of your Jelly page:

<g:evaluate var="jvar_cabMeetingId">
  RP.getWindowProperties().get('cab_meeting_sys_id');
</g:evaluate>

Then use:

cbgr.addQuery("cab_meeting", jvar_cabMeetingId);

This will make your page dynamically use the CAB Meeting ID passed from the UI Action.

 

 

Thanks and regards,
Siddhesh Jadhav


Please mark my answer helpful and accepted if it solved your problem.

Hi @aviavillan ,

Here’s a working example I used on the Incident table to pass the assignment_group sys_id to a UI Page and display the group name using Jelly.


UI Action Script:

function openAssignmentGroupDialog() {
  var groupId = g_form.getValue('assignment_group');
  alert(groupId); // just to verify

  var dialog = new GlideDialogWindow('attendee_notifications_popup');
  dialog.setTitle('Assignment Group Info');

  dialog.setPreference('assignment_group_sys_id', groupId);
  dialog.render();
}

 

 UI Page Jelly Code:

<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="true" xmlns:j="jelly:core" xmlns:g="glide">

  <!-- Get sys_id from dialog preference -->
  <g:evaluate var="jvar_groupId">
    RP.getWindowProperties().get('assignment_group_sys_id');
  </g:evaluate>

  <!-- Get group name using sys_id -->
  <g:evaluate var="jvar_groupName">
    var name = '';
    var gr = new GlideRecord('sys_user_group');
    if (gr.get('${jvar_groupId}')) {
      name = gr.getValue('name');
    }
    name;
  </g:evaluate>

  <p><strong>Assignment Group Name:</strong> ${jvar_groupName}</p>
  <p><strong>Assignment Group sysId:</strong> ${jvar_groupId}</p>

</j:jelly>

This approach works perfectly for showing reference values in a UI Page passed via GlideDialogWindow.

 

Let me know if you need help expanding this!

 

Thanks and regards,
Siddhesh Jadhav


Please mark my answer helpful and accepted if it solved your problem.


SiddheshJadhav_0-1750530314891.png

 

Screenshot 2025-06-21 235557.png

 

SiddheshJadhav_1-1750530546833.png

 

View solution in original post

Hi @aviavillan ,

Just checking in — did this solution work for you?
If it helped resolve your issue, kindly mark it as Accepted.

Let me know if you need any further assistance!

Thanks and regards,
Siddhesh Jadhav

Ankur Bawiskar
Tera Patron

@aviavillan 

you can pass sysId from UI action to UI page using this syntax and grab it and then use it further to set in glidelist macro

UI Action: How to send

dialog.setPreference('sysid', '<Your SysId>');

UI Page:

<g:evaluate var="jvar_sysid" expression="RP.getWindowProperties().sysid"/> 

<g:evaluate jelly="true" object="true" var="jvar_attendeearray">
		var sysId = jelly.jvar_sysId;
// now use this to query and hold the user sysIds in array and use in macro
		
	</g:evaluate>

<g:macro_invoke macro="lightweight_glide_list" id="change_subsystem" name="change_subsystem" control_name="myListCollector" reference="sys_user" can_write="true" control_name="QUERY:active=true^sys_idIN${jvar_attendeearray}" />		

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post