Script include not working on call Dynamic Filter option

SystemsGo
Tera Contributor

Dear experts,

can anyone help on my issue.

 

I've created a Dynamic filter option like below

 

SystemsGo_1-1754392396518.png

The ACL is like below with all the internal user can read this Filter

 

SystemsGo_0-1754392316702.png

 

And the script include:

SystemsGo_2-1754392591989.png

 

var UXDynamicFilterUtils = Class.create();
UXDynamicFilterUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
	getMyRegionAssignmentGroup: function() {
		gs.info("====start=====");
		var groups = [];
		var currentUser = gs.getUser(); 
		var returnValue = "";
		gs.info(currentUser.isMemberOf("SC Shanghai"));
		if(currentUser.isMemberOf("SC Shanghai")){
			groups.push();
			groups.push("aaa");
			groups.push("bbb");
			
		}else if(currentUser.isMemberOf("SC Singapore")){
			groups.push("cc");
			groups.push("dd");

		}else if(currentUser.isMemberOf("SC Japan")){
			
			groups.push("ee");
			groups.push("ff");
		}
		gs.info("======returnValue=====");
		return groups.join(",");
	},

    type: 'UXDynamicFilterUtils'
});
But when I run  that dynamic filter from list filter, it got empty, and didn't get into the script include.
SystemsGo_3-1754392668144.png

 

Can anyone help to find what this issue is?

 

 

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@SystemsGo 

you should push group sysId into that array and not name

check this and see if any step is missed

Create your own Dynamic Filters 

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

anshul_goyal
Kilo Sage

Hello @SystemsGo,

You can refer the below article as well:

https://www.servicenow.com/community/csm-articles/creating-dynamic-filter-option-to-fetch-the-incide...

If my response resolved your query, kindly mark it as Accepted and Helpful for future reference.

Best Regards,
Anshul

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@SystemsGo 

you should push group sysId into that array and not name

check this and see if any step is missed

Create your own Dynamic Filters 

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

Thank you for your reply.

 

I've push the group sys_id to groups, the reason is I should return groups, not group.join

anshul_goyal
Kilo Sage

Hello @SystemsGo,

You can refer the below article as well:

https://www.servicenow.com/community/csm-articles/creating-dynamic-filter-option-to-fetch-the-incide...

If my response resolved your query, kindly mark it as Accepted and Helpful for future reference.

Best Regards,
Anshul