Context: The custom collection points to my staff table. The collection within it points to a relation column which shows all available booking timeslots for that staff member. When the user selects a date I want to be able to add it to a table that contains all booked timeslots and assign that booking to the staff member. I am having a hard time with this because in the collection item actions for the dates I can’t access the staff member details
I have a table containing all dates for the next three months
On the table w/ all dates I do some array computations to end up with a final array of available staff (email addresses) for each date (this considers things like rosters, time off, staff capabilities, etc)
I have a multiple relation on the staff (users) table to match their email with the array of available staff emails for each day
OK, I think I understand. So ultimately the table with all of the dates is not linked in any way to specific staff. It’s just a generic list of dates, correct?
This is kind of tricky. Normally, before we had the custom collection, your only option would have been to have a collection of staff, then click on a staff member to view their details. At that moment, you could set up a custom action to save the chosen staff member somewhere, such as the user profile table or some other table, before showing the details of the staff member. Since your custom collection is really showing the details of each staff member, there isn’t the opportunity to temporarily save a chosen staff member.
I’m not sure about the best way to approach this. My only thought would be to create an action on the date list that would write the selected date to a column in the user profile when clicked. Then have a button inside the custom collection that would actually write a new row to your Booked table. That button should have access to all staff member details as well as the chosen date stored in the user profile.
@Jeff_Hager it sounds like we’re on the same page. It’s more like a group of staff members linked indirectly to the dates via intermediary tables.
It is a generic list of dynamic dates for the next three months that I feed arrays of staff emails into from other tables via a day number relation (eg 20221021 for today). The purpose of the other tables is to store and relate things like annual leave and rosters (eg they are in the field Monday and Wednesday but in the office Tuesday and Thursday with Fridays off). If the user is booking in a field based task then only the staff rostered for the field (amongst other conditions) on that weekday will be available.
Once I have weeded out all of the staff that are unavailable to be booked, I am left with an array of various staff emails for each day which is how I pull the available dates into the staff table.
This relation on the staff table is what I am using as the custom collection source.
Using the custom collection is nice because the user can see all available staff and the days they can book each one, all from the same screen. I was hoping to save the staff member and the date all in one go.
I will have a fiddle with your suggestion and do some pondering, though it sounds like it might mean extra clicks.