Display users based on their last time they logged in

Is there a way to add the last time a user logged in in order to delete the ones that are not active after a certain period ?

Not easily.

What I usually do is pick one or more components that I can be pretty sure that my users will touch each time they open the app, and attach an action to those components that updates a “Last Active” date/time column in my User Profiles table. It’s not perfect, but it’s good enough for my purposes.

Important to understand the distinction between “logging in” and “using the app”. Glide sets an authentication cookie the first time a user logs in, and that will keep them logged in indefinitely. The only time they’d need to log in again would be if they:

  • deliberately logged out,
  • deleted cookies from their device,
  • or opened the app in a different browser, browser profile or device

And of course, it’s also possible for a user to reject the authentication cookie (if you give them that option), in which case they’d need to sign in the next time they opened the app.

2 Likes

Like a welcome screen … I like the approach and it should work also for me … but how can I trigger a welcome screen each time a user opens the app without displaying it inside the app ?

You can’t.

But you could do it based on time. So if we take the example of my “Last Active” timestamp in the User Profile table, what you can do is use a math column to determine how long it is since that timestamp was last updated: Round(Now - Timestamp)

And then you can have a visibility condition on your Welcome Screen based on that value. eg. only show the screen if it’s more than one day since it was last updated, for example.

Again, it’s not perfect, but a reasonable solution.

3 Likes

I like how you think :slight_smile:

Thanks a lot

2 Likes