Real Time tracking issue

I am working on a native app on Bubble that will allow the user to input all the food they have in their fridge including the expiration date, so the app can track the expiration dates and inform the user when items are about to expire.

I am struggling to adapt to the real-time functionality.
At the moment, the app can show how many days till the expiration date once an item has been added to the app(digital fridge/homepage of the app). however, this information doesn’t update daily and i am not sure how to make that happen.
I want to know if i need a plugin or to change my workflow in any kind of way to allow for this functionality, I am completely lost on what to do going forward.

I have included screenshots of what that feature currently looks like on the app.

The days remaining shouldn’t be stored in the database since that is a calculated value.

Instead just store the Expiration Date in a date field, then on screen do Expiration Date - Current date/time:format as days (with some kind of rounding probably)

Then you’ll want some condition where if it is < 0 (implying it is past the expiration date) you multiple it by -1 and change the text to “X days expired” so you aren’t showing negative numbers

You can still sort by the Expiration Date just as if you were sorting by the ProdExpDays

1 Like

Alright, the reason I stored it in the database is because i wanted to use that information in order to create notifications as the food get closer to the expiration date.
Will i still be able to do that if it is not in the database?

Yea I think so, you can still sort by Expiration Date and get the upcoming ones.

Then if you had any search constraints to find some expiring within 14 days like
ProdExpDays < 14 it can be converted to Expiration Date < Current date/time :rounded down to date + days (14) (rounding down so its not time specific)