Forum Academy Marketplace Showcase Pricing Features

Help with searching database to show dropdown options


I have an app that involves a scheduling function. I have a page where I create new events and part of the process is creating a new event and assigning staff to the event.

To assign staff, I use 2 data types on each event record:

  1. Lead Coach: 1x user
  2. Other staff: A list of users.

To avoid scheduling conflicts, I wish to have the dropdown of staff dynamically remove staff that have other events at the same time as the proposed event.

I can do this with the lead coach field and it works, but I am trying to merge these results with another search for users that are listed as ‘Other staff’ in events running at the same time.

Any ideas on how to implement this? I have a feeling that it’s something to do with this returning a list of users, not a single user.

Overall expression for dropdown data source:

First search pulls all coaches from the overall user database:

This search finds events that are at the same time as proposed new event and then I create a list of users that are the lead coach in these events - it seems to work up until this point.

I am now trying to look for the same events as previous, but now looking to list any staff in each event listed as ‘other staff’