Associating different fields with each other in many to many relationship

Hi, I am not a programmer so I may not be using terms correctly but I’ll try my best. I am stuck at this point in making my MVP app. Essentially, I have 2 collections: Employees and Locations. I have a screen where users can add locations to a list and same thing with employees.

Users can then click a location and then click “associate employee” which will bring up a list of employees with a toggle button on the list. The point of this is that a user can view employees and click the toggle button to associate them with the particular location address.

The above is where I am stuck. I am not sure how to associate employees with locations through the toggle button. In the database, in the employees and locations collection, I created a many-to-many relationship where it said “A Location can have multiple Employees / A Employee can have multiple Locations”. This is definitely going in the right direction but when I toggle the employee, it doesn’t show up in the previous page (see screenshot for these two pages). I also put another screenshot showing how I modified the toggle.

This is showing how I configured the toggle button. I only had one option to pick from.

Hi @paulc ,

Showing list of location under employee does not have to use toggle, it just needs filter like current user>location.

If you want to build in public and get clone-able app for that, you can join the waitlist, link in my profile.

Hi thanks for the reply. I mean for the part where it shows a list of employees under location, I would like a toggle for the user to pick what employee works where. Let’s say we are at location B and the list includes Employees A, B, C, D, and E. I would want the user to associate Employees C and E with location B if that is where they work.

And thanks for the info, do you have 30 subscribers yet?

Check this clone-able app,

Having 30 subs is still long way to go, but if you want to be one of the first, you can join the waitlist, it should be an act of willingness to contribute.

Oh wow that worked great, thanks! And yes sure, I can. Is there anything I need to do?

Just clone it and see what is inside.

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