Just thought I’d share a quick video showing one of many ways you can introduce “user streaks” into your app. For example, you could use this in a Workout app where you reward members for logging workouts on a daily basis.
I’m sure there are better/more resource efficient ways of getting this done (I’ve already spotted ways to improve my own solution ) but a Loqode student asked how it could be done in our Q&A this morning so I thought I’d post the solution I came up with here as well.
If you have any questions, want the Google Script code, or have suggestions on how this can be improved I’d love to hear from you!
Creative, nicely done
Side note: I suspect the reason why you couldn’t use greater than/less than with the streak count is probably because your script returns the number as a string. If you run that through a Math column (multiply by 1) that should coerce it into a number.
And the direct numerical comparisons is also a great suggestion that I think you’ve mentioned to me before… One day it will sink in
Yeah, I think it’s generally better to keep everything self contained if you can. I used to use a lot of Apps Script when I first started with Glide, but these days I try to avoid it and will only use when absolutely necessary. In fact, my preference these days is to build exclusively with native tables. Not always possible, of course, but that’s what I do if I have the choice.
Just another note about passing dates as integers. Another reason to do that - probably the most compelling reason - is that it eliminates the possibility of being tripped up by variations in date formatting across user devices. That one is a real gotcha that can be really hard to debug.
Agreed. You present a tidy solution within Glide itself, but I prefer to avoid scripts if I can. As @Darren_Murphy mentions, keeping things self contained produces more responsive UX.