Hi all,
I'm using the below rule to retrieve all the group members from a group constant and then exclude one of the groups from the same group constant. Below code with remove() function is not working. Could anyone please help how do I exclude a group? (Note: I do not want to simply remove the member from the group instead remove it in the rule to pass because of visibility restrictions)
Code:
load(
local!approvers: a!groupMembers(
group: CONS!ARC_GROUP_APPROVERS,
direct: true,
memberType: "GROUP"
),
local!dash: a!remove(
local!approvers, cons!ARC_GROUP_SAFETY_PLATFORM
local!dash
)
Thanks,
Kumar
Discussion posts and replies are publicly visible
Hi Kumar,
Remove function's second parameter is an index(not a value itself) of the array which is a first parameter. So I hope the below code will work for you.
load( local!approvers: a!groupMembers( group: CONS!ARC_GROUP_APPROVERS, direct: true, memberType: "GROUP" ), local!dash: remove( local!approvers, wherecontains(local!approvers,cons!ARC_GROUP_SAFETY_PLATFORM) ), local!dash)
Sree Devi Jayakumar
Thank you for the reply sreedevij When I run your suggested code I'm getting the below error:
Expression evaluation error at function 'wherecontains' [line 9]: Invalid types, can only act on data of the same type (DataSubset, Group)
Can you please suggest?
Please try the below.
load(local!approvers: a!groupMembers(group: CONS!ARC_GROUP_APPROVERS,direct: true,memberType: "GROUP"),local!dash: remove(local!approvers.data,wherecontains(cons!ARC_GROUP_SAFETY_PLATFORM,togroup(local!approvers.data))),local!dash)
Thanks a lot Sree Devi it worked.