It’s entirely possible to compare a single date range with a list of date ranges in vanilla Bubble. The list operator you’re looking for is :filter
. Also, date ranges do have the :overlaps operator, just like numeric ranges.
So, how you do this in Bubble is as follows:
Let us say that we have that we have a scalar date range (let’s call it daterange
) and now we also have a list of date ranges (let’s call it drlist
).
And now we want to know: “Does daterange
overlap any of the date ranges in drlist
?”
That’s just:
drlist:filtered by This date range overlaps daterange
What this does is iterates over all of the date ranges in drlist
, comparing each with the scalar daterange
. The result will be the list of date ranges in drlist
that overlap with the date range represented by daterange
.
Now, how is that useful? Well, if this resulting list has any items in it, daterange
must overlap one of them. If the resulting list has NO items in it, daterange must NOT have overlapped any of the ranges in the original list.
So, we can write:
drlist:filtered by This date range overlaps daterange:first item is not empty
this expression yields the boolean Yes if daterange
is found to overlap any range in drlist
.
Or we can write:
drlist:filtered by This date range overlaps daterange:first item is empty
this expression yields the boolean Yes if daterange
did not overlap any of the ranges in drlist
.
And so, now you can see that we have expression that we can use as an “only if” conditional. So your workflow can have a Make Changes to A Thing action that will trigger only if daterange
does not overlap with any of the ranges in drlist
.
Now, this expression building can look pretty hairball if it takes a complex expression to yield drlist
and daterange
, right?
And, sometimes, you might not actually be able to build the required expression at all.
BUT, since you’re already using List Popper, have a look at the Flow State SSA and Flow State List SSA actions in there. These are just like custom states on the client side. You shove an expression into their inputs and the resolved expression appears at their outputs.
(Also, I think the Flow State actions weren’t totally compatible with Things, so I pushed a new update to List Popper and Friends v 1.0.5 which fixes that, not that it affects the use case I describe above.)