I’d appreciate some help with this issue I’m having as I’ve spent quite a few hours trying to solve it without any luck.
I’m building a scheduler app and want to create a list of possible datetimes that a meeting could take place. For context, each person’s available time slots is stored in an ‘Availability’ data type which includes a Start and End date for each ‘Availability’. In the context of this app, playdate is a timeslot where two people’s availability overlaps.
What I’m trying to achieve is this. From the current user’s point of view, create and show a list of his available timeslots that overlaps with availability provided from any of this user’s friends. ‘Friends’ is a List of Users that is stored inside each user.
What I currently have (which doesn’t work) is this.
Step 1: Search for all availabilities by users who aren’t the current user.
Step 2: Compare each availability from step 1 with all availability entered by the current user. Check if the daterange of each availability by users who aren’t the current user overlaps with any of the dategranges entered by the current users.
The only way I got it to do anything is to check whether other users’ start date (per availability) ‘is in’ any of the current user’s availaiblities’ dateranges. However, ‘is in’ only works when they match exactly, rather than when they overlap. Therefore it’s not what I’m looking for.
When I try that, it complains that the filtered value should be yes/no but right now it’s empty. I suspect it’s because I’m comparing each Availability’s single StarDateTime with a list of start times derived from the PlaydateDateRange:start, but I don’t quite get why that would be an issue.
In the Search for Availability, do not use :filtered operator as you are not supposed to use an Advanced filter. Instead in the Search for Availability add the constraints there.
In an attempt to simplify it for myself, I created two repeating groups of availabilities, one containing the current user’s list (RepeatingGroupMyAvailabilities) and the other containing everybody else’s (RepeatingGroupNotMyAvailabilities). The final outcome I’m looking for is a list of everybody else’s availabilities whose dates overlap with the dateranges from any of the date ranges in the current user’s list.
Any and all help in solving this is very much appreciated
Yes indeed. Each user has a list of available timeslots and I’m trying to find the overlapping slots and suggest them to the users in order to book meetings where multiple parties are available at the same time.