Need Help! prevent users from requesting a duration that exceeds their remaining time quota

Hi everyone, I’m building an attendance utility in App Inventor. Each user has an annual time quota of 6 hours, and they can “use” portions of it (example: leaving 4 hours early deducts 4 hours from the quota) and if excess the quota like only about a minutes, the system won't accept automatically.

The quota is stored in a google sheets as a text string, for example "6:00:00" or "1:00:00". but i have no idea how to solved it.

Please help

Your data format on the sheet should be for the benefit of the app, which is the only user interface.

You are tracking remaining minutes.

The Clock component from the Sensors Drawer has time conversion blocks.

multiply 6 hrs to numbers, clock timing 1000 which is equals to 1 second. when clock 1 do minus from 6 hrs. Note 1000 = 1 second. If you want complete project development dm me. Have a nice day.

There are two approaches to keeping a sum in a remote database:

  • keep just one row per user, and retrieve it before updating it, or
  • keep increments by user by datetimestamp, and just add a new row to add more usage history.

The first approach needs more logic to ask for the current sum, then update it after it arrives.

The second approach makes updates easier, by adding a row to the sheet regardless of what was there before or how big the sheet is, at the expense of filtering the sheet and adding up the usage to get total usage. I consider it easier.