Let’s say I’ve got a list with different activities. For each activity there are some different Properties like:
- Name of activity
I would like to have the ability to show different activities from this list based on the current season. So during winter I want to show only Ice hockey and skiing and during summer I want to show soccer and running for example.
One idea I had was to set a time span property (eg. Jan-May) for each activity that I could then filter on but couldn’t make that work.
Anyone have an idea on how this could be achieved?
Hey there @Bobzifer
You’ve got the right idea.
You can have “Activities” collection and “Seasons” collection. You’ll need a relationship between activities and seasons.
Seasons will need 2 date parameters to mark the date that the season starts and the date to mark when the season ends. So name the date parameters as “Start Date” and “End Date”
Then, you can have a list of “Activities” with a filter where “Current activity > season > start date > is before > Current time” and another filter where “Current activity > season > end date > is after > Current time”.
This will only display activities that are marked with the season and the date is between the start/end dates.
@Flawless Many thanks for your reply and great suggestion! It worked great!
The only issue see now is that this will only work for one year from now on since you can’t seem to select just the month and day when using the date parameter. So whenever the date has passed it won’t work for next year’s season.
I understand. There’s 2 ways you can do this.
- You can update seasons, since there’s only 4 per year, you have plenty of time to update between seasons.
- Add “months” and “days” to the season collection and then you can use inputs to compare/filter.
For example, you can have a month and day as number parameters. Same thing as before, you’ll need 2 month parameters and 2 day parameters. Month start, day start, month end, and day end. So if a season starts on May 31st, for example, you would put “Month start” value as “5” and day number as “31”
Add an input to your screen with a default value of “Current Time” > “Month Number” and name this “month input”. Then add another input with a default value of “Current Time > Day number” and name this “Day Input”
Then, you’d use those inputs as filters, like
This filter is if the month is the same as the current month of the start.
“Current activity > season > Month # > is less than > Month start Input” and “Current activity > season > Day # > is less than > Day Input” and “Current activity > season > Month end > is greater than > Month End”
You’ll need to add another filter if the season’s month is before and the end month is the same. And 1 more filter if it’s in between 2 months (like if the season starts in June (6th month) and you have summer between 5 and 7).
This may get a little tricky at first but it’s doable.
Yeah ok, I think I got it! I tried setting the dates just as number parameters as you suggested but missed the part with adding an input to the screen.
I’ll play around a little bit and see if I’ll be able to make it work. Otherwise i might just have to live with updating the start/end date manually a few times a year, at least for now.
I’m really grateful for your time and help!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.