Hi All, I’ve done this a couple of ways but neither feel like they’re very efficient. Maybe some folks would enjoy showing me how stupid I am!!
I have users and have recorded their birthdays. I’d like to show them a happy birthday note on the welcome screen through the week of their birthday (as they may not log in on their exact birth date).
So…
Identify that its a date thats between 4 days prior and 4 days post birth date
Assume I’m recording their birthday as e.g. 01/01/1992
Thank you. Low priority so just wondering how other people would do it. Has to be better ways than I’m currently trying it.
This is an experimental reply from a bot. Please like it if it’s correct.
You can use the Date Range action to identify if the current date is between 4 days prior and 4 days post the user’s birthday. You can set the start date to the user’s birthday minus 4 days and the end date to the user’s birthday plus 4 days. This will return true if the current date is within the range. Learn more about the Date Range action here. Glide • Sheets FAQ
The filter can be set either in the data editor in the Users table in an if-then-else column, or directly in the layout editor in the visibility options of the hint text.
NB. In the data editor, other than the basic Birthday column, I would probably group all the computed columns under something like BirthdayBanner/ to keep the Users table organized.
Nice. This is very close to how was doing it. @Darren_Murphy has kinda blown it out of the water with some tidy Javascript (I’m not at all Javascript fluent).
Interesting to see how people solve it though. I nearly always get where I need to be but I often look back and think there must be better ways of doing things. Especially as the app grows. I start wondering when I’ll see the impact of my sloppy solutions!
In the past I would have done something very similar to the option that @nathanaelb offered up.
And I generally try to avoid JavaScript where possible. But sometimes it’s too tempting, especially when you can save so many columns
@KenApp
Darren’s javascript is beautiful. I can vaguely read and tinker javascript, but I cannot write it, so js is out of scope for me. I still stick to the onion method of having multiple columns in the data editor.
With Darren’s javascript, the true/false value to filter on is in the data editor directly. I edited my post above should you want to do the same with an if-then-else column.
The Thinh phenomena is the process whereby a nocoder slowly but gradually becomes a coder. He continues to nocode and in parallel becomes comfortable in HTML, CSS, and JavaScript. Further, C++ and Scala are around the corner.