AppSheet

How to restrict access to AppSheet App Based on Office Hours?

In a recent project, I had to build an inventory management app for a warehouse. The challenge was straightforward: I needed to restrict access to the app so that it could only be used during office hours — from 9:00 AM to 6:00 PM. The goal was to ensure that only authorized users could update inventory data when the warehouse was operational, and prevent any changes after hours.

The Need for Time-Based Restrictions

In a warehouse, keeping inventory data accurate is crucial, but it should only be updated when the team is actively working. Allowing access to the app outside of working hours could lead to accidental changes, or worse, unauthorized access.

So, to make sure the app was only accessible during office hours, I decided to implement a simple time-based restriction.

The Simple Solution

AppSheet allows you to set conditions for when data should be visible or editable. For this task, I used a basic formula in the **Security Filter** to restrict access. Here’s the formula:

AND(
TIME(NOW()) >= “09:00:00”,
TIME(NOW()) <= “18:00:00”
)

What does this do?

– TIME(NOW()) gives us the current time.
– The formula checks if the time is between 9:00 AM and 6:00 PM.
– If the current time is within this range, the user can access the app. If it’s outside of this window, access is blocked.

How It Works in the Warehouse?

The warehouse staff needs to update inventory data as shipments arrive or when stock levels change. By using this formula, I ensured that the app was only available when the warehouse was open and staff was on-site. After 6:00 PM, no one could make changes to the system, preventing any accidental updates.

Screenshot

This setup works seamlessly, ensuring that only the relevant personnel can access the app when it’s time to manage the inventory, and nobody can alter the data when it’s not needed.

How it helps?

This simple solution works well because it automatically enforces the desired access control based on the warehouse’s working hours. It’s easy to set up and doesn’t require any complex user management or permissions. It ensures that the system remains secure and data integrity is maintained without any manual intervention.

Conclusion

By using this time-based restriction, we ensured that the app is available only when needed, making it an efficient tool for warehouse inventory management. It’s a simple, yet effective way to control when your app is accessed, and it works perfectly for operations that rely on real-time data updates.