UI Builder - fetch sysId's from selected records and put it in modal servicenow ui builder

Mohamed_Hazik
Tera Contributor

Hi all,

I have a question regarding the list component.
Is there a way to fetch the sys id's of the records selected in the list component and pass them to a viewport modal?

I’ve attached the modal screenshot and the list screenshot for reference. I would like to populate the selected record names inside the modal.

 

Mohamed_Hazik_0-1779363548653.pngMohamed_Hazik_1-1779363681612.png

 

3 REPLIES 3

martinvirag
Mega Sage

unfortunately as of now I don't remember having any events that is exposed and contains the sysId's. (but you can still check all the event handlers). As a workaround I usually use a repeater for this with a selectbox component. The selectbox event contains the sysId of the selected object and you can work with that. 



Regards,
**Martin Virag**
ServiceNow MVP 2026

I have created a page collection to display a viewport modal on the record page. Now, based on the guide me on where exactly I should use a repeater?




PoonkodiS
Giga Sage

Hi @Mohamed_Hazik 

1. https://www.servicenow.com/community/developer-forum/ui-builder-list-component-fetch-sysid-s-from-se...  Refer this solution to get the selected list records

2.create a client  state parameter to store the selected list records, then configure the client state parameter with the step 1 event payload

3. https://www.servicenow.com/docs/r/zurich/application-development/ui-builder/add-viewport-modal.html

 

Hope it helps