Skip to main content
chrisg0006
March 3, 2025
Solved

Query the Security Groups for an Application

  • March 3, 2025
  • 12 replies
  • 0 views

Has anyone ever created a query for Security Groups?  I need to pull the security groups for an application.  If I were smarter or more experienced, I would have created a Group Type of System to enter the system abbreviation for the security group when I first created the application.  In that way, I could have used the a!groupsByType() function.  The only way to do that now, is to create all new security groups and go through all of the application objects to reassign the security groups for all applications!! :(

I created an expression rule to pull all of the custom security groups.  It returns all of the custom security groups from all of the applications when I am looking for one application. The data is returned with type List of Variant.  It seems to me that there should be a way to filter the data returned to see if the name contains the application abbreviation I am looking for.  I'm stuck on how to do that.

a!groupsByType(cons!PMSO_CustomGroupType).data

I set the output to a local variable in the expression rule and tried several types of queries.  No joy there either. I kept getting different error codes.  I couldn't get the query structured correctly.

If someone could point me in the right direction, I would appreciate it.

Best answer by stefanhelzle0001

You are welcome :-)

Nothing wrong with getgroupnames(), but it comes from a plugin. If you want to minimize plugin usage, the built-in function group() would work just as well for your use case.

12 replies

karumurua531442
March 3, 2025

Hi [mention:47f656218bd54913aefbdc1e97de975f:e9ed411860ed4f2ba0265705b8793d05]  AFAIK look like you are on right track. Now the steps would you need to filter out your data using some other functions like find() and pass your app prefix and filter the groups may be 

stefanhelzle0001
March 3, 2025

What do you try to achieve?

I go a different route. Each group has an "All Groups" group, holding all the groups of an app. Then, I could create a new group with a membership rule to add all these groups by name.

chrisg0006
March 3, 2025

 I am creating an interface to add users so that I don't have to do that (there is just me here).  Then the office administrators can add users without calling me.  I want to be able to have them select the type of user (security group) the use goes into.

mathieud0001
March 3, 2025

I usually end up exposing the Groups via an API and creating a Service Backed Record Type that consumes the API. Much easier to query then. I think I'll write up a small blog post on this.

mathieud0001
March 16, 2025

Apologies in advance for bumping this thread, finally got around to writing up a blog post on how to query groups using Record Types for those who are interested: https://blog.appiandevs.io/003-a-better-way-to-work-with-groups-in-appian-part-1/ 

kalpeshg0081
March 23, 2025

Hi [mention:f5e81b8502fa4e77ad12697686a4fc56:e9ed411860ed4f2ba0265705b8793d05] , I am not able to access the blog. It is giving 404.