I’m building an app in Bubble where users can log their daily calories, carbs, fats, proteins and more… I want to automatically reset these daily logs for each user at the start of a new day, while also preserving historical data for trends and user insights.
I have tried using recurring events but they seem to be tied to individual users which they also need to trigger an event for the API Workflow to work.
Is there a way to globally schedule the reset or there are better ways to implement it?
Just as an idea, since I know there are several ways to do one thing, what about creating a new thing for each day that they log instead of resetting their data? Then just display the data for today but also keep a history of their logs. So there wouldn’t necessarily be a ‘reset’ but just creating a new thing based on the day. Does that make sense? Let me know. I think someone has actually asked about this on the forum previously.
How can I make a recurring event that will automatically save user data? even when the user is offline
And another question:
In theory, how can I implement a feature where the user can access past information?
For example, the user should be able to select a specific date and view all the data from that day while keeping the UI consistent.
Currently, I can access data through the database like this: Current User > today-consumed-calories.
But how can I dynamically display information for a specific date that the user selects and ensure they see the correct data for that date?
Sorry for all the newbie questions I’m new to this and trying to understand the logic.
No worries. So I wouldn’t want to use Current User. You probably need to create a new dataType for all the data you are saving each day. Are you saying that if they don’t have any data to add, you still want to add data for them?
So lets say you have a dataType called ‘Log’
Then this is what the fields could look like.
Log
Calories
Carbs
Fats
Proteins
Date
User
Then you can search it based on day to display the data that you want to display. Then in privacy rules, make sure the user can only see their data.
Okay, so if I understand correctly, I should create a “Meal Log” that records every time a user adds a new meal. This log will be accessible only to that specific user, and through the log, they can view all the meals they’ve entered.