Changed ! Merged with / Intersect with - two date ranges

Hey there automation fans, I have something of a headscratcher

I want to create a “featured gigs” slideshow of events for my bar / restaurant app.

The featured gigs will be the 2 soonest, i.e. today and tomorrow PLUS one featured that could be further in the future.

I have a Featured = yes/no field, but how can I best automate the 2 soonest gigs to be Featured = yes

Does something like Zapier need to be used?

If I am understanding what you are trying to do, you don’t need to Zapier. When you build your slide show, it’s all about the data source.

For the gigs today and tomorrow, do a search for gigs and use date parameters to find these two gigs. That way, you don’t have to change the flag, when the date changes the data source will update automatically.

Then use the merge with expression and do another search for gigs, but use the flag to narrow it down and the date is greater than tomorrow, and use the random item expression to give you a featured gig.

Use the merged searches as your data source and your slide show should work.

1 Like

This sounds very sophisticated @jdiaz ! I’m going to try it now, but I have a feeling i’m going to get stuck… :joy:

Well, close but no cigar, @jdiaz - I have got it to show the second part, the featured gigs, but not the soonest two (i.e. today / tomorrow)

I’ve tried ‘merged with’ and ‘intersect with’

Here’s a screenshot of my current setup…

thanks again!

@emma1 ,

Quick question, in the database, do you have two events, one for today and one for tomorrow?

But if you want to pull the next two events (in case you don’t have one today or tomorrow), you can change the search to the following:

Search for Events without a constraint, but use the sort on the Event Date and Time with descending set to no. Then use the :items until # expression and add the number 2. This will pull all the events you have and then take the first and second items from the list to display.

Still use the merge with and do a search for events with the feature flag used, but add a constraint where the featured gig’s event date is at least a week out (so that the random item is not one of the gigs from the first search and you end up with only two results). Use the :random item expression on the second search and you should have it.

that’s a great shout, although I guess should still have the constraint to not include dates from the past…?!

Yeah, sorry. I’m thinking through this conceptually in my head. You could also add a date in the future to return a smaller list, something like 7 days. Just make sure to pull the featured one after that time period to prevent pulling the same gig twice.

1 Like

@emma1 can I suggest something like this:
image

Where I put users put your events. Your first search is events closest to now, so just switch your date constraint to “≥ current date”, the items until #2 gives you the “soonest” two events. Then merge with the second list.

The second list should be one random event that is not one of the previous two selected. So let’s grab three events happening later, sort by random.
image

You grab three in case up to two of those are the ones you selected for part 1 of your merge. Now make the list unique, and grab the first three items which would be:

Soonest event, next soonest event, one random event in the future, which is different from the previous two.

Hope this helps.

2 Likes

that worked spectacularly, thank you @duke.severn ! really appreciate your time and detailed explanation :smiley:

1 Like