how RetrievHi, Selected Record sys_ids from List-Type Declarative Action in ServiceNow Server Script

prasanna16
Tera Contributor

Hi,

I've created a list-type declarative action for my workspace experience in ServiceNow. I need to access the sys_ids of the selected records within the server-side script, but I'm unsure of the correct method to retrieve them.

I've tried incorporating the action field label into the declarative action's label using the placeholder {{sysIds}}. This displays the sys_ids of the selected records on the client side when records are chosen, but I require access to this data in the server-side script where the main logic is implemented.

can someone please advise on how to pass or obtain these selected sys_ids in the server script?

2 ACCEPTED SOLUTIONS

@prasanna16 

this link has script

Workspace, add a List button that will process Selected records 

AnkurBawiskar_0-1758202903407.png

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

@prasanna16 

Hope you are doing good.

Did my reply answer your question?

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

10 REPLIES 10

Ankur Bawiskar
Tera Patron

@prasanna16 

then use client side and use GlideAjax and pass those sysIds and then perform server side logic.

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

@Ankur Bawiskar Thanks for the reply. Could you provide a small Client Script code snippet that shows how to get the sysIds?

@prasanna16 

this link has script

Workspace, add a List button that will process Selected records 

AnkurBawiskar_0-1758202903407.png

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

@prasanna16 

Hope you are doing good.

Did my reply answer your question?

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