Clean-up Report: Teams, Groups, Companies with no members | Community
Skip to main content
quarkmage
New Participant
October 25, 2023
New

Clean-up Report: Teams, Groups, Companies with no members

  • October 25, 2023
  • 8 replies
  • 1381 views

Thinking this report may have been created by someone already-

 

Report that shows teams, groups, companies with no members towards clean up of unused objects.

(thinking of @randyroberts and past amazing clean up report scripts).

Thank You.

8 replies

quarkmage
quarkmageAuthor
New Participant
October 31, 2023

Cool @william-- 

 

thanks, that works.

William--
New Participant
October 31, 2023

@quarkmage 

 

Apologies, for the company filter, you can use the below to show companies with no active members: 

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=USER EXISTS:a:companyID=FIELD:ID EXISTS:a:isActive=true

 

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
quarkmage
quarkmageAuthor
New Participant
October 31, 2023

22 companies with no members.

@william-- 

 

when i try to append companies report 

 

EXISTS:a:$$EXISTSMOD=NOTEXISTS
EXISTS:a:$$OBJCODE=USER
EXISTS:a:companyID=FIELD:ID

with:

Append EXISTS:a:user:isActive=true to the above filter to list companies with no active members.

i get a "whoops" something went wrong error.  without the appendage, report runs fine.

quarkmage
quarkmageAuthor
New Participant
October 31, 2023

48 teams with no active members, OH MY!

quarkmage
quarkmageAuthor
New Participant
October 31, 2023

awesome, thanks for the feedback @randyroberts and @william-- .  will try this out and let you know if i encounter any issues.

suspect we had a lot of teams setup, and then the members became deactivated.

thanks for the support, love the clean up efforts.

RandyRoberts
New Participant
October 26, 2023

Thanks @william-- , I figured you already had a solution 🙂

William--
New Participant
October 26, 2023

Yep, text mode filters below:

Companies with no members:

 

 

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=USER EXISTS:a:companyID=FIELD:ID

 

 

Append EXISTS:a:isActive=true to the above filter to list companies with no active members.

 

Groups with no (active) members. (Groups require at least 1 member, but that user may not be active in some cases):

 

 

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=USRGPS EXISTS:a:groupID=FIELD:ID EXISTS:a:user:isActive=true

 

 


Teams with no (active) members. 

 

 

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=TEAMMB EXISTS:a:teamID=FIELD:ID EXISTS:a:user:isActive=true

 

 

In the above Teams filter, you can remove the last line to list teams with no members at all.

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
RandyRoberts
New Participant
October 25, 2023

I'm flattered 🙂

You don't have to worry about teams as you cannot have an empty team.

I've not tried to get a members list for Groups or Companies and members are not listed as collections in the API. Maybe @doug_den_hoed__atappstore or @skyehansen or maybe @william-- may know how to get to members from the group or Company object. 

From the user object, it's here:

displayname=All Groups listdelimiter= listmethod=nested(userGroups).lists namekey=group.plural textmode=true type=iterate valuefield=group:name valueformat=HTML

or Here:

valuefield=companyID querysort=companyID valueformat=HTML linkedname=direct namekey=companyID