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.

Reference Qualifier that filters out Groups user is not in

samuelbingham
Tera Contributor

Hello, I am trying to create a reference qualifier on a catalog item field that is referenced to the sys_user_group table. I want the reference qualifier to filter out groups that the user in my user field in my catalog is in. Can some one help me? This is what I have so far. 

2 REPLIES 2

DrewW
Mega Sage

You need to add the "ref_qual_elements=what_user" attribute to the variable that has the ref qual you posted.  Where "what_user" is the name of the the variable that references the user.

 

This may help

https://www.servicenow.com/community/developer-articles/creating-dependent-variables-in-service-cata...

 

I also think your refqual needs to be something like this

 

javascript: "^RLQUERYsys_user_grmember.group,>=1,m2m^user=" + current.variables.what_user + "^ENDRLQUERY"

 

 

And if you want to filter out the groups the user is in then change the ">=1" to "<=0"