Hi,
I’m pretty bad at all things Zapier/Make, in short the back end. I’m coming to you again to ask how I can change a certain property of a user based on time.
Example: I have a number property, a date/time property, I want every 12h the user’s number property to reset to zero, and the date/time property another 12h, and again, and again.
I can do this in the front end, but I don’t want the user to have to open the application for the actions to take place.
And do I need to have my app’s API? If possible do without, but if I really have no choice, I’ll have to upgrade, which would hurt given the price difference between pro and team.
Thank you for your attention.
Hi @DarthSztoru,
If you’d like to change some property’s value in the database, logically thinking, there are 2 ways to do it: either Adalo app does this or you access the database using some other way. Currently Adalo Collections API is the only supported way to do it.
However, depending on your usecase, you may avoid using Collections API. If the property you’re using is relevant only when a user actually uses the app, then it doesn’t really matter, when it is reset; your goal is to have it in the correct state when user launches the app next time. Therefore, you can add something like an on-screen-enter action on Home screen; this action should check the conditions and reset the property if required. Most probably you’ll have to store datetime in an additional property as well. I’d look at the approach to store “reset time” (in your example current time + 12 hrs), and when the reset time is before current time, update property to 0 and also update reset time again with current time + 12 hrs. Of course the exact implementation will depend on details.
Another approach is to have another “admin” app, which you will have to keep open, and use this app to launch the reset actions (manually or automatically using countdown timer).
But for proper backend update you will have to use Adalo Collections API.
Best regards, Victor.
Okay, I’m thinking about all that;
I have another question : Is the Current Time
value based on the server time or on the user’s device time?
I want to make sure that users can’t bypass some limits simply by changing the time on their phone.
Thanks a lot for your help!
@DarthSztoru Current Time in Adalo app is based on user device’s time.