We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

g_list.getchecked not working in declarative action

Sachin G K1
Kilo Sage

Hi All,

when user click ui action, I want to retrieve the sysids selected in the list view of workspace. g_list.getchecked is not working. In Below script alert message is not firing 

 

Declarative Action.png

 

 

Thanks in Advance!

1 ACCEPTED SOLUTION

Hello @Sachin G K1 ,

 

just refer this code :

 

function onClick()

{
var data=g_list.getChecked();

alert(data)

}

View solution in original post

14 REPLIES 14

Bhanu Vamshi
Tera Contributor

@Sachin G K1 , May I know what type of action assignment you have created this one. I mean, is it list actions, related list actions?

 

@Sachin G K1 , Make sure to check the "Record selection" field checked on List Action Assignment form and use the below script.

 

function onClick() {
alert(g_list.getChecked());
}


This script will return comma separated checked sys_ids and I hope you created the Action Assignment from All>Now Experience Framework > Declarative Actions > List Actions


If my answer is helpful, please mark this as helpful

@Bhanu Vamshi Not working, can you try in Zurich version.