Flow that automates adding group type to a user group with specific conditions

Wendy20
Tera Expert

Hi all,

I am looking to create a flow that automates adding "group type" to a user group  that contain a certain word. for example all groups that contain the word "change" will be added Group type "ITIL".  Any advice on how to do this with flow designer will be appreciated. Thank you!

2 ACCEPTED SOLUTIONS

Hi,
You can create a onBefore insert a business rule with condition name contain "change" set type as "ITIL".

SaurabhGupta_0-1672175715917.png

 

SaurabhGupta_1-1672175727956.png

 

 

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

Hi,
Remove set Action value as itil and check the advance checkbox and write below code

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var curTyArr=[];
	var curTy=current.getValue('type');
	if(curTy)
		curTyArr=curTy.split(",");
	curTyArr.push("1cb8ab9bff500200158bffffffffff62");//Type as ITIL
	var au=new ArrayUtil();
	current.setValue('type',au.unique(curTyArr).join(","));//


})(current, previous);

 

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

6 REPLIES 6

Hi,
Remove set Action value as itil and check the advance checkbox and write below code

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var curTyArr=[];
	var curTy=current.getValue('type');
	if(curTy)
		curTyArr=curTy.split(",");
	curTyArr.push("1cb8ab9bff500200158bffffffffff62");//Type as ITIL
	var au=new ArrayUtil();
	current.setValue('type',au.unique(curTyArr).join(","));//


})(current, previous);

 

 


Thanks and Regards,

Saurabh Gupta

Thank you so much for your help.