How to fetch/use "Conditions" section in script ?

Virendra K
Kilo Sage

Hi All,

I have below UI with source = sys_user. I am fetching below 1428 records using "Condition" .

If we enter "Per user cost" then we should get "Total cost".  

for ex.     Per user cost = $50

                        Filtered User as per Role   = 1428

                So Total cost = $71400

This user set named as "ITIL" with specified roles in Condition.

How I could access given Condition part in script?

Also, Condition may be vary/dynamic   like if some other person create "Admin" user set then he/she may set different condition.

So can we dynamically access the conditions?

Or else

How we could access Count 1428 (marked in yellow) using script ?

find_real_file.png

3 REPLIES 3

Simon Christens
Kilo Sage

The field name is: conditions


So if you creates a GlideRecord, grab the record and then var con = gr.conditions then the value is the query



After that, create a new GlideRecord to sys_user, and use usr.addEncodedQuery(con) to query with the same query as the subscription user set


Thanks Simon


Its helped me to get the count.


Ulrich Jugl
ServiceNow Employee
ServiceNow Employee

You can also use GlideFilter to achieve the same


GlideFilter - Scoped