"Configuring Dynamic Filter in ServiceNow UI Builder for SOW"

ROSHINIB
Tera Contributor

I'm trying to add a condition to the data resource of the Problems related list component on the Change Request record page in Service Operations Workspace (SOW) using UI Builder. The condition should be 'Assignment group is (dynamic) One of My Groups AND Active = true'.

 

Is this feasible in UI Builder? If so, what steps should I follow to configure this condition?

 

Any guidance or examples would be appreciated."

1 ACCEPTED SOLUTION

Shruti
Mega Sage
Mega Sage

Hi,

Navigate to System definition -> Script includes

Shruti_0-1753355313859.png

 

Update the script include "ChangeRequestRelatedListProblemItemFilter"

var ChangeRequestRelatedListProblemItemFilter = Class.create();
ChangeRequestRelatedListProblemItemFilter.prototype = {
    getFilterQuery: function(tableName, parentFieldName, parentRecordSysId, referencedFieldName) {
        return "active=true^rfcISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744"; //assignment group is one of my groups
    },
	
	handles: function(extensionPointKey){
		return extensionPointKey == "CHANGE_REQUEST_PROBLEM_RELATED_QUERY_FILTER";
	},

    type: 'ChangeRequestRelatedListProblemItemFilter'
};

View solution in original post

1 REPLY 1

Shruti
Mega Sage
Mega Sage

Hi,

Navigate to System definition -> Script includes

Shruti_0-1753355313859.png

 

Update the script include "ChangeRequestRelatedListProblemItemFilter"

var ChangeRequestRelatedListProblemItemFilter = Class.create();
ChangeRequestRelatedListProblemItemFilter.prototype = {
    getFilterQuery: function(tableName, parentFieldName, parentRecordSysId, referencedFieldName) {
        return "active=true^rfcISEMPTY^assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744"; //assignment group is one of my groups
    },
	
	handles: function(extensionPointKey){
		return extensionPointKey == "CHANGE_REQUEST_PROBLEM_RELATED_QUERY_FILTER";
	},

    type: 'ChangeRequestRelatedListProblemItemFilter'
};