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.

DATABASE VIEW to bring Groups which users are located in specific location

Vinicius Luz1
Tera Expert

Hi All,


I have the following setup on my database view and I'm not sure why is not working:

ViniciusLuz1_0-1731527481267.png

 

@Brad Bowman   can you help?

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

I think you probably want something more like this if you want to show one row for each user that is in the assignment group of the task:

BradBowman_0-1731529335027.png

You don't need to include the user table as you can add the User column from the grmember table, then dot-walk to any fields on the user table that you want to see

BradBowman_1-1731529558317.png

To limit the results to only Incident, Problem, and Request Items, create a before Query Business Rule using the Database View name as the Table.  The script would look like this:

(function executeRule(current, previous /*null when async*/) {
	current.addEncodedQuery('task_sys_class_name=incident^ORtask_sys_class_name=problem^ORtask_sys_class_name=sc_req_item');
})(current, previous);