Hide-when woes - multiple conditions required

Hi All

I have a need to hide an action button from everyone bar those who fall into the intersection of two groups, and I can’t grasp the required logic for it. Last night’s office Christmas party might have something to do with this…

Anyway, the conditions are as follows:

  • Must be a member of the group “Service Delivery”

  • Must have the role “[Admins]”

In this database are documents created with the form “AppActGroup”, which is used to define groups. The members field is set to Names, Allow multiple values. The role is attached to various entries within the ACL.

There are currently three people who should be able to see this button, one of which is the authorised design profile that we use to sign design changes. I have set up a test document that confirms that this profile is both in the required group and has the required role, but the action remains invisible. The formula I’m using is as follows:

tmp1:=@IsMember(“[Admins]”; @UserRoles);

tmp2:=@IsMember(@Name([CN]; @UserName); @Explode(@DbLookup(“”:“”; “”; “AppGroups”; “Service Delivery”; 2)));

@Sum(tmp1; tmp2) !=2

The view “AppGroups” contains a comma-separated list of the names of the group members in the second column, using the following formula:

@Implode(@Name([CN];GroupMembers); “,”)

What am I doing wrong?

Subject: Hide-when woes - multiple conditions required

I take it your users have spaces in their names? Like between the first name and the last name, for instance? You might not want to use @Explode without the separator string argument, then, since a space is one of the characters that the string will explode on by default.

Subject: Hide-when woes - multiple conditions required

Do you have a good reason for needing to @Implode the values in the second column of the view? I not and you can just leave them as multiple values then

! @UserNamesList *= “[Admins]”:@DbLookup(“”:“”; “”; “AppGroups”; “Service Delivery”; 2)

should do the trick.

Subject: Hide-when woes - multiple conditions required

a:= @DbLookup(“” ;“”;“AppGroups”;“Service Delivery”;“GroupMembers”);b:= @UserRoles;

@IF(@Ismember(“[Admins]”;b);@Success;@Return(@True));

@If(@Ismember(@Name([cn];@userName);a);@False;@True)

Subject: RE: Hide-when woes - multiple conditions required

Thanks Stan and Elizabeth.

I tried both your suggestions, and neither one worked. This surprised me, so I tried adding a field onto a test document that would allow me to see the results of various formulae. Turns out that the @Name([CN]; @UserName) wasn’t required, as the formula was pulling back a list of canonical names…