The CreatorCon Call for Content is officially open! Get started here.

GRC Choices dependency

ServiceNow SA
Kilo Guru

Hi Team,

Is there a way we can make grc choices dependent? For eg:

In control objectives form, requirement is to make classification dependent on Category. 

find_real_file.png

 

For sys_choice, we do have dependent value but  i dont see that in sn_grc_choice. 

Have anyone built this type of requirement?

3 REPLIES 3

Periyasamy P
Tera Guru

Mentioned column type is reference. So what you can do, add column parent in "sn_grc_choice" table and update reference qualifier to make this dependency.

 

new sn_grc.GRCChoiceUtils().getGRCChoices('category', current.sys_class_name)
new sn_grc.GRCChoiceUtils().getGRCChoices('type', current.sys_class_name)
new sn_grc.GRCChoiceUtils().getGRCChoices('classification', current.sys_class_name)

But how will it make it dependent? 

Client wants if they select Category, then limited choices in Classification should be visible.

The reference qualifier already has this :

find_real_file.png

 

As i mentioned, first add parent (Referencing to "sn_grc_choice") column in GRC choice list table and update your choice with correct parent. And script as below,

Current,
getGRCChoices: function(category, currClassName) {				
		return 'choice_category=' + category + '^set=' + this.setTableMap[currClassName];
},

Update to,

getGRCChoicesWithDependent: function(category, currClassName, dependentColumn, current) {				
		return 'choice_category=' + category + '^set=' + this.setTableMap[currClassName]+ '^u_parent='+ current.getValue(dependentColumn);
},


And update your reference quqlifer script with new function,

new sn_grc.GRCChoiceUtils().getGRCChoicesWithDependent('classification', current.sys_class_name, 'category', current)