Skip to main content
omkaro0002
Known Participant
Jun 24, 2022 1:27 PM UTC
Question

Get list of users.

How can I get the list of active and inactive users without using any plugin?

13 replies

mikes0011
Brainy
Jun 24, 2022 1:56 PM UTC

I'm not sure this is generally possible without the use of a plug-in.  Can you share what use case you have that requires you to not use any plug-ins?

The Expression Guru
stefanhelzle0001
Brainy
Jun 24, 2022 2:31 PM UTC

A list of all users is simple. Create a group and add all users via a membership rule. Then query that group using a!groupMembers().

No OOTB solution for the inactive users.

davel001150
Inspiring
Jun 24, 2022 6:53 PM UTC

There's actually an already existing group called "All Users" that does exactly what Stefan said.  It uses a rule to gather every user in the system to itself.

I don't know if this still holds true, but in the past users were flagged inactive by being placed in an "Inactive Users" group that you could find, though I can't seem to find it now.

Handy little snippet for finding all of your group IDs:

a!forEach(
items: enumerate(300),
expression: try(
concat(fv!item, " - ", group(fv!item, "groupName")),
"That's not a group"
)
)

You shouldn't try using try() for anything that ever might make it to production, but for your own investigation in /rule that you're going to throw away in minutes, I say knock yourself out.

stefanhelzle0001
Brainy
Jun 25, 2022 7:03 AM UTC

I think you should be careful when suggesting brute-force "solutions" that also include calls to internal API and unsupported functions.