How to use Dynamic 'Filter Conditions' in a Business rule?

Suggy
Giga Sage

Today we are using a Filter condition like this:

Suggy_0-1751287108256.png

The groups can change often, which needs an update to the Business rule, and I want to avoid that.

 

Is there way to use a script or system property or anything in the 'Filter conditions' or under the 'Condition' field under advanced section and make it dynamic?

 

PS - I know that can achieve it by writing code in script field, I dont want run the script. I want to run the script only when the condition matches. ie if assignment group is one of (A or B or C) etc

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Suggy 

you can check the property value in Advanced condition field of business rule

Filter conditions are for more simpler conditions and advanced condition can handle scripting.

your advanced condition will look like this

system property will hold comma separated sysIds of the 3 groups

gs.getProperty('propertyName').split(',').indexOf(current.assignment_group.sys_id.toString()) > -1

AnkurBawiskar_0-1751289412823.png

 

You can also try to use Dynamic filter options, I haven't tested this

Create a dynamic filter option 

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Suggy 

you can check the property value in Advanced condition field of business rule

Filter conditions are for more simpler conditions and advanced condition can handle scripting.

your advanced condition will look like this

system property will hold comma separated sysIds of the 3 groups

gs.getProperty('propertyName').split(',').indexOf(current.assignment_group.sys_id.toString()) > -1

AnkurBawiskar_0-1751289412823.png

 

You can also try to use Dynamic filter options, I haven't tested this

Create a dynamic filter option 

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

@Suggy 

Thank you for marking my response as helpful.

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