Date picker that filters not picked

My site has a feature that users can pick dates from our upcoming schedule. I would like the list that they pick from to include only the dates they have not picked.

How do I actively filter the list to dates they have not picked?

I’ve tried to query the schedule linked by their selections and then filter the dates they have not picked but right and left join does not work??

What do you mean by:

when they use the dropdown to see future date I want it to include only the dates they have not picked already

Ah, so you are using a dynamic dropdown and not the date picker component?

How are you storing the events and per-user selection?

one table is the schedule of available dates

The other is the “results” including the dates picked from each team. They are linked by the event ID

You can indeed use table join and then in the query condition use user ID column NOT EQUAL to User ID

This will return all the events, which are not assigned to the selected user ID.

But the results column contains the ID of other teams therefore I get numerous dates and duplicates

I need to somehow include the entire schedule including the dates the team has picked the THEN exclude the team

You then need to write a custom query OR if you want to use the query builder you will need two queries.

  1. A query, which filters the users table by the user ID (output option not needed here)
  2. Another query, after this which filters the events table using NOT IN and the event IDs returned by the users query. So in your second query, you add your events table and then in the filters - select event id NOT IN: {{query1.join(",", "eventid").split(",")}} where eventid is the event ID returned by the first query (just change it with your column name).

I haven’t tried this yet but how to I query the data from the first query? a repeat?

Just follow the two steps as I explained. No repeater is required.

I did this but I’m not getting the expected result. Can I send you the link?

What do you get then? Is it showing wrong results or is it not showing results at all?

What did you setup for both queries filtering? Can you attach screenshots of this?

From the results I selected one team (which i will later filter with getID) and the races scheduled this year. I did output them just to make sure they show

The next Query I selected the Schedule and filtered it to future dates and the RaceID per your code

I can see the results from the first query but the second one give me no dates (and it should)

And are there actually any future events, which correspond to the query1 results? Is your first query called query1?
On your screenshot I don’t see the bottom of query builder dialog where the generated query can be seen.

Yes there are dates and the query is query1


So do you see any results from the second query if you remove the NOT IN filter?

I tried that and it actually changed the results of the first query to “just” the races I selected.

Not sure what you mean?
The second query should not affect the first one in any way.

correction - It shows the selected races and ALL of future races with the NOT IN statement removed

Please add a set value step after the first query, enable output and use the expression which you used in the NOT IN filter - can you tell me if the setvalue step returns any values?