# How do you track a user's approximate last active time in Adalo?

Update a User Date/Time property from selected screen actions to record the last screen the logged-in user entered.

- Canonical URL: https://adalocado.com/answers/track-user-last-active-time-adalo
- Verification: Documented from current sources
- Topic: Database and Relationships
- Skill level: Beginner
- Last reviewed: 2026-08-25
- Index status: index-now

## Short answer

Add a Last Active Date/Time property to Users, then add a screen action on each important logged-in screen that updates Logged-in User > Last Active to Current Time. Treat the value as the user's latest tracked screen entry, not an exact logout, swipe, tab-close, or idle timestamp.

Use screen entry as a practical activity signal. A screen action updates the logged-in user's Last Active Date/Time to Current Time whenever the user reaches a selected authenticated screen.

The value is intentionally approximate. It tells you which tracked entry happened most recently, but it cannot detect an exact tab close, app background event, swipe, or idle timeout. Track meaningful screens, protect the timestamp as user activity data, and label the result accurately wherever it appears.

## Intended outcome

Each tracked user record contains an approximate timestamp for the most recent important screen the user entered.

## Requirements

- A Last Active Date/Time property in the Users collection
- Screens that users reach only after logging in
- Permission to update the Logged-in User record
- A clear retention and visibility policy for activity timestamps

## Step by step

1. **Add the activity field**

   Open the Users collection and add a Date/Time property named Last Active. Do not use a Text property because the saved value should remain sortable and date-aware.

2. **Choose meaningful screens**

   Track screens that represent real activity, such as Home, Dashboard, Messages, or a main work screen. Avoid adding the write to every minor modal unless that precision is worth the extra database updates.

3. **Add the screen action**

   Select the screen title, open its Actions section, add an Update action, and choose Logged-in User as the record to update.

4. **Save Current Time**

   Set Logged-in User > Last Active to Current Time. Repeat the same action on each selected logged-in screen.

5. **Display and protect the value**

   Show Last Active as a relative or Date/Time value where needed, and restrict who can view or edit the User property through collection permissions.

## Why it works

- Adalo screen actions run automatically when a user lands on a screen, so each tracked screen entry overwrites the previous Last Active timestamp.
- The newest saved timestamp identifies the latest tracked screen entry. It does not prove that the app remained open, that the user interacted after landing, or when the browser tab closed.
- Tracking only meaningful screens reduces unnecessary writes while still providing a useful coarse activity signal.

## Data model

| Collection | Properties | Relationships |
| --- | --- | --- |
| Users | Last Active Date/Time plus the standard user fields | No additional relationship is required; each logged-in user updates their own record |

## Common failures

### Last Active stays empty

Confirm the screen is reached after login, the action updates Logged-in User, and the Last Active property is included in that Update action.

### The timestamp does not change on a tracked screen

Open the screen's Actions section and verify the mapped value is Current Time. Then publish the latest app changes and test with a fresh screen entry.

### The timestamp updates too often

Remove the action from minor screens and keep it on navigation points that represent meaningful activity. Screen actions run each time the screen loads.

### A logged-out visitor causes the action to fail

Use the update only on authenticated screens where Logged-in User exists. Do not attach it to Welcome, Signup, or Login screens.

## Testing checklist

- [ ] Log in, enter a tracked screen, and confirm Last Active changes to the current time on that user's record.
- [ ] Wait one minute, enter a different tracked screen, and confirm the newer timestamp replaces the earlier value.
- [ ] Close the tab without navigating and confirm the timestamp remains the last tracked screen entry rather than claiming an exact close time.
- [ ] Last Active is a Date/Time User property
- [ ] Each tracked screen updates Logged-in User
- [ ] The saved value is Current Time
- [ ] Unauthenticated screens do not run the update
- [ ] Activity timestamps have appropriate view and edit permissions

## Limitations

- This records screen entry, not swipe activity, backgrounding, tab closure, logout, or true inactivity. Adalo does not provide a reliable close-event timestamp through this forum workflow.
- Screen actions run every time a screen loads. Tracking too many screens increases database writes and can make the value noisier than the app needs.
- A Last Active field is activity data. Limit who can view or edit it and disclose its use when appropriate.
- Adalocado did not reproduce the workflow in a current builder project.

## Community evidence

### [Lastactivity Time](https://forum.adalo.com/t/lastactivity-time/65085/2)

The accepted reply recommends a Last Active Date/Time User property updated to Current Time from screen actions. Boundary: The reply explicitly describes the result as the last screen entered, not a reliable signal for when the user stopped using the app.

### [Lastactivity Time](https://forum.adalo.com/t/lastactivity-time/65085/3)

The source author confirmed that the screen-action method worked in the app. Boundary: The confirmation does not measure write volume, background behavior, or precision across native and web apps.

## Sources

- [Adalo forum accepted solution](https://forum.adalo.com/t/lastactivity-time/65085/2)
- [Adalo forum author confirmation](https://forum.adalo.com/t/lastactivity-time/65085/3)
- [Adalo Help: Screens](https://help.adalo.com/component-basics/inserting-and-editing-screens)
- [Adalo Help: Action Basics](https://help.adalo.com/action-basics/action-basics)
- [Adalo Help: Database](https://help.adalo.com/database)
- [Adalo Help: Temporary User Avatars](https://help.adalo.com/how-to/how-to-create-temporary-user-avatars)
- [Adalo Help: Collection Permissions](https://help.adalo.com/database/collection-permissions)

Markdown version: https://adalocado.com/answers/track-user-last-active-time-adalo.md
