Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get query of filter conditions of list view in UI action

Yu_G
Tera Contributor

Hi everyone,

 

I want to get the query of filters created on list view in UI action.

g_list.getQuery({orderby:true}); was used, but it didn't work.
Anyone with good ideas? Thank you so much.
3 REPLIES 3

SN_Learn
Kilo Patron
Kilo Patron

Hi @Yu_G ,

 

Please check the below doc:

GlideList2 (g_list) - Client 

 

//GlideList2 - getQuery(Boolean orderBy, Boolean groupBy, Boolean fixed, Boolean all)

 

Mark this as Helpful / Accept the Solution if this helps

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

dgarad
Giga Sage

Hi @Yu_G 

Refer to the below link.

https://developer.servicenow.com/dev.do#!/reference/api/utah/client/c_GlideList2API#r_GL2-getQuery_B...

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Addy22
Tera Guru

Hi @Yu_G ,

You can try (g_list.getQuery(false, false, true)) - It will return current query on the form.

 

And if you are looking just for the fixed queries , go with [getFixedQuery()]