Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
GP
65
Views
2
Comments
Tips on finding inactive users?
Question
Anyone have any good tips for finding and deleting in bulk inactive users? I have a customer that's right near the user limit for their tier, and while
I'd
like them to upgrade, they'd rather do some housekeeping first. :-)
Paulo Ramos
Staff
What do you mean by
inactive
?
Users explicitly inactivated (shown if you click the
Inactive Users
link in the /Users app).
Or users that don't login for a long time (e.g. one year).
For the 1st scenario, I'm not sure if inactive users count for licensing purposes (they can't login anyway)...
Nevertheless, these users are in the
User
entity, that you can reference from the
(System)
eSpace (it's already referenced by default when you create a new module). This way, you can build a query returning all your inactive users (you can filter for attributes
Is_Active
or
Last_Login
, depending on your goal above).
Once you have this list of users, you can delete them in bulk using the DeleteUser entity action inside a ForEach loop. This is where you may run into problems, since your application entities may be referencing some of these rows, and if they are using a
Protect
delete rule
, the database will throw an error. So, you have to decide what to do on these cases (clear YourEntity.UserId? update it to a special "deleted" user? change the delete rule to
Ignore
?...).
By the way, if you're using multi-tenancy, you may want to double-click the User entity and select
Show Tenant Identifier
(Advanced tab), so it returns users from all tenants. And be careful not to delete useful but rarely used users, like the default Administrator.
1 reply
01 Oct 2013
Show thread
Hide thread
GP
Users that don't log in for a long time...
I'll send my customer to this thread (more traffic for the community!) and see where we go from there. Obrigado!
Paulo Ramos
wrote:
What do you mean by
inactive
?
Users explicitly inactivated (shown if you click the
Inactive Users
link in the /Users app).
Or users that don't login for a long time (e.g. one year).
For the 1st scenario, I'm not sure if inactive users count for licensing purposes (they can't login anyway)...
Nevertheless, these users are in the
User
entity, that you can reference from the
(System)
eSpace (it's already referenced by default when you create a new module). This way, you can build a query returning all your inactive users (you can filter for attributes
Is_Active
or
Last_Login
, depending on your goal above).
Once you have this list of users, you can delete them in bulk using the DeleteUser entity action inside a ForEach loop. This is where you may run into problems, since your application entities may be referencing some of these rows, and if they are using a
Protect
delete rule
, the database will throw an error. So, you have to decide what to do on these cases (clear YourEntity.UserId? update it to a special "deleted" user? change the delete rule to
Ignore
?...).
By the way, if you're using multi-tenancy, you may want to double-click the User entity and select
Show Tenant Identifier
(Advanced tab), so it returns users from all tenants. And be careful not to delete useful but rarely used users, like the default Administrator.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...