Remove a group from a group constant in a rule

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

Parents
  • 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
    )

    Thanks,

    Sree Devi Jayakumar

Reply
  • 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
    )

    Thanks,

    Sree Devi Jayakumar

Children

 Discussion posts and replies are publicly visible