Streaks on glide

How can I create streaks for every time a user opens my app?

You can make your first page as a landing page everytime the day changes!
So they would need to click a button before going into the app! You can make it fancy by showing streak info and a small illustration!

On click, add a row to the table and roll up or increment the column in the user table! If you choose to increment, you might need complex function to take of streak as the button should be clicked next day of the previously clicked day!

If you need any help setting up, you can DM me!

2 Likes

Here’s how I do streaks (it’s complicated):

As @ShantanuIyengar mentioned, it needs to be triggered manually by a “check in” button of some kind. There is no action trigger for “when app is opened”.

2 Likes

hey @Robert_Petitto, how would you alter this if there’s multiple rows with the same “day only”? I’ve used your tutorial but ended up with a 3 day streak for someone who should have a 1 day streak because they posted 3 times in 1 day, resulting in 3 rows. Would appreciate any help! thanks

I haven’t watched the video, but sounds like you can:

  • Add a row ID to that table
  • Use a math column to convert the date value to numerical format: YEAR(D)*1000 + MONTH(D)*100 + DAY(D) with D being the “day” you’re considering.
  • Use a template column to combine the user’s ID/email (the person who posted) with the numerical value above.
  • Create a relation from that template column to itself, make it a single match.
  • Use a lookup column to return the rowID column from that relation.
  • For your “streak” calculation, use only rows where rowID equals to the lookup value above.
2 Likes

What @ThinhDinh mention should work. Either that or use a second column for the streak date. And write to that column only if the user hasn’t already created a record for the day ( you would need to add a condition in your action).

1 Like