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

@Sachin G K1 , The code which I sent is in Zurich version. You just need to remove the parameters g_form, g_list...
or else you can use the code which I sent.

Hope this helped.

Aditya_hublikar
Mega Sage

Hello @Sachin G K1 ,

 

In my PDI it is working. Are g_form, g_list, g_action, and g_scratchpad provided as out-of-the-box parameters? Because in the my  Xanadu version they are not coming as OOTB parameters.

 

risk2.png

 

risk.png

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya

 

 

@Aditya_hublikar parameters are given oob, i tried some other functions of g_list, which was working. but i facing issue with getChecked().


Hello @Sachin G K1 ,

 

can you please share screenshot of your list action . Means after clicking that ui action actually whats happening .

Nothing is happening,
lets suppose if i place any alert message before using getchecked, its getting shown