Stuck with a filter in RG


I`ve been stuggling with a filter for a while, and cannot seem to get what I do wrong, have tried multiple approaches, and just need an input on what can be wrong.

The pop-up I have screenshot is a result of pressing Assign Resource on a booking on the underlying page.
This booking contains a TIME that is a range(start/end), a SKILL, and a SKILL LEVEL.
The filtering with skill and skill level is ok and working properly.
It also has an ASSIGNED property which is populated by the user that this pop-up assigns.

The last puzzle is the TIME bit.
What I want is to filter out the users that is in bookings that is overlapping with the current booking. ( so they cannot be overbooked ).

Ive tried to:
Search for Booking(Assignee = This User, Time overlaps with Parent Groups Bookings Time) is 0/empty
Search for Booking(Assignee = This User) 's Time doesn’t contain Parent Groups Bookings Time
Parent Groups Bookings Time is not in Search for Booking(Assignee = This User) 's Time

A logical thing for me would be:
Parent Groups Bookings Time overlaps with Search for Booking(Assignee = This User) 's Time
but this just glows red, as it is not a yes/no but empty.

This doesn’t address your question specifically, but the first thing I’d suggest is doing as much “filtering” server-side as possible, which doesn’t involve using the “filter” expression at all - but rather using “constraints” on the initial “Search” expression.

With your current implementation, every single user is being pulled from the DB and transferred to the browser (very resource intensive), and then the subset of users in which you’re interested is being narrowed down client-side (in the browser). That approach will cause serious performance issues as your app scales.

In short, use constraints in the initial search (which happens on the server) instead of filters on the search results (which happens in the browser) whenever possible. Otherwise, you’ll get slower and slower page load times as your app grows.

1 Like

I am aware of the constraint vs filter problem.
I will see if there is better way to restructure the DB for this use…
IMO it just gets so messy when you store data multiple places, but yes, maybe I can just make a Booking data on the user that connects to the booking the user is assigned to…

Yaah, reason why I can’t go that approach is that I can’t do the advanced filtering on the constraint.

For the most part I try to constraint my searches, and filter what I need.
But this one is kind of tricky, cause it is comparing so many different variables :stuck_out_tongue: