Skip to main content
July 9, 2024
Question

I need to get groups for a member user without using function getgroupsformemberuser() (function from plugin: People Functions) as we do not have support for this function in newest version 1.16.0

  • July 9, 2024
  • 12 replies
  • 1 view

Hey Everyone,

I am facing an issue while getting the groups for a user.

We used to make use of function getgroupsformemberuser() from plugin People function version 1.10 jar

We need to update the People function plugin to 1.16.0 jar but in this newest update, getgroupsformemberuser() is not supported.

Replacement for getgroupsformemberuser() function looked a!groupsForUser() but result set of both is not matching.

When I use getgroupsformemberuser(), I get 70 groups list which is absolutely perfect.

When I match with the number of groups for loggedInUser from Users in Appian: It shows 70 users

Means, getgroupsformemberuser() output matches with actual groups.

But when I use a!groupsForUser() appian built in function, it return 72 groups:

Conclusion: Output is not matching as it's returning 2 more groups which I don't have permission to view. 

Is there any way that these 2 extra [NO PERMISSION] groups can be removed from this result set? Issue is that these 2 extra values are of group type and not null or empty otherwise it would have been easy to remove these extra 2 values.

Or is there any other way of achieving the functionality of getgroupsformemberuser()?

12 replies

csteward
July 9, 2024

I would recommend sticking with a!groupsForUser(), and I'm sure we can filter those out.  Assuming those groups have a securityMapName of "Personal"? Run this in your environment to verify (assuming it allows you to call fn!group() properties in your context) - from there you can make a filtering rule to use with fn!reject().

a!localVariables(
  local!groups: a!groupsForUser(
    username: loggedInUser(),
    isGroupAdministrator: false
  ),
  
  a!forEach(
    items: local!groups,
    expression: group(fv!item,"securityMapName")
  )
)

July 10, 2024

It's not allowing us to access the property "securityMapName" for the same 2 groups and gives us this error: 

sarathkumr268295
July 10, 2024

Seems there is some permission issue. Please check the visibility and privacy settings of the group.

July 12, 2024

This function also has one parameter named as groupType. Is this also not helping you? I check that if we don't pass groupType, then we also get two additional groups with NO PERMISSION.

July 15, 2024

Issue is that not all the group types are visible to me, I have tried applying all the group types that are visible but we don't get all the expected groups in output as there are still many groupTypes that aren't visible