Declarative Action "current" in Server Scripts Returns Null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 09:57 PM
Hi Community.
I created a new list action using Declarative Action with the implementation set to "Server Script."
Normally, in server scripts, the current object should represent the record from the triggered context. However, in my case, it is returning null.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 10:09 PM
did you try printing some field value in it?
Is this for existing record or fresh record?
It should work ideally as there are many OOTB Form Actions which are Server Side which use current object
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 10:40 PM
@Ankur Bawiskar Thank you so much for your reply.
This is for existing records, and the button is located at the top of a list component (Created by UI Builder).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 10:43 PM
Thank you for marking my response as helpful.
Since it's a list banner, you will have to select some record using that checkbox and then click it
Then only system knows the Current object is for which reocrd
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 10:49 PM
It still returns null even after selecting multiple records and clicking the button.