I need help about relationship and filter

Hello. I need a little help. Could you pls explain me how I can resolve this case:
I have 3 tables - User, Equipment and Appointment. Users can use a several Equipments. Users can register a several Appointments. I want to check when user registers to the Appointment this Equipment is free or not.

I created 3 relationship between User and Equipment, Appointment and User, Appointment and Equipment. And I don’t know how to check this tables between together :frowning:
I want to show for the login user the List where will be only free appointments with free equipments for this user.

I will try more details about it:
Jim can use Equipment number 3 and 4. Sam can use Equipment number 4 and 5. Sara can use Equipment number 4 only.
Sam register to the Appointment with equipment number 4. Jim want to register this Appointment too and Jim can do this, because the Equipment number 3 is free but Sara can’t do this, because Equipment number 4 is occupied.

You will need to add a boolean property to your equipment collection for “Available”. When an equipment is occupied by a user then you would need to set this property to “false”.

That way you can filter the list of equipment to only show equipment that is available.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.