Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to skip approval of the member who is requester and belongs to group in Group approval activity of workflow?

kushal6
Kilo Explorer

I want to skip approval of member in group who is also requester of request?

5 REPLIES 5

Manas Kandekar
Kilo Guru

Hi Kushal,

Create 'If' activity before your approval activity,

Write script to check the requester is member of particular group.

 

eg. I check manager and Dept VP are same or not. If NO then create the second approval else skip.

find_real_file.png

 

find_real_file.png

 

If my answer helped you in any way, please then mark it correct and helpful.

Kind regards,
Manas

Hi Manas,

First of all thank you for inputs:).

But my scenario is bit different where i have to check whether a requester belongs to approval group(which we can implement by scripting) and if requester is part of approval group then only he's approval should get skip(where i am facing challenge) and other members should get approvals as it is.

Hi

In approval activity, click advanced to write the following script,

var groupId = //pass the sys_id of group.

var gr2 = new GlideRecord('sys_user_grmember');
gr2.addQuery('user',"!=",current.variables.requested_for);
gr2.addQuery('group',groupId);
gr2.query();

while(gr2.next())
{
answer.push(gr2.user);
}

 

find_real_file.png

AbhishekGardade
Giga Sage

Helloo Kushal,

Add this code in IF ACTIVITY and If yes then skip approval and IF No then point to approval activity:

answer = ifScript();

function ifScript() {
var reqFor = current.variables.requested_for ; // replace with your value for requester for.
if(reqFor.isMemberOf(current.assignment_group)){
return 'yes';
}
return 'no';
}

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade