Declarative Action "current" in Server Scripts Returns Null

Amane1
Giga Guru

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.

 

image.png

 

image.jpeg

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Amane1 

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.

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

@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).

image (1).jpeg

 

@Amane1 

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.

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

@Ankur Bawiskar 

It still returns null even after selecting multiple records and clicking the button.