Count consecutive days

Hi Bubble Community

I’m stumped trying to create a count of consecutive days.

I have a data type that has 3 boolean fields and a date field. When all three fields are ‘yes’ for that day, I would like that to add 1 to another ‘streak’ field, or reset to 0 tomorrow. The users will have the ability to select ‘yes’ or ‘no’ on the three fields. Only when all 3 are ‘yes’ should it add a 1 to the streak. If the user selects all 3 ‘yes’, then edits to ‘no’, this should revert back to yesterday’s count.

This feels like it should be done with a couple different workflows to add or subtract from ‘streak’ given the criteria. Maybe a workflow that looks at yesterday’s fields and resets to 0 if any of the three are ‘no’.

Any recommendations on a smooth setup?

Sure it’s easy enough once you see it.

Have a look at this video. They add seconds, minutes, hours, days, weeks etc to a display field on the screen.

It’s the same process if you wanted to update a database value using a workflow.

This topic was automatically closed after 70 days. New replies are no longer allowed.