Add additional fields for Lookup

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
superpablopunch
Posts: 1
Joined: 2015-05-28 20:57

Add additional fields for Lookup

Post by superpablopunch » 2015-05-28 20:59

Hello, I am wanting to additional fields in my create function for employees. My employees can belong to many locations and my locations can have many employees. When i created the lookup field I can only select one location. How can i create an additional field dynamically to add an additional location after the first is selected?

User avatar
gregsintx
Posts: 15
Joined: 2015-05-09 06:25

Re: Add additional fields for Lookup

Post by gregsintx » 2015-05-29 20:22

Sounds like you need to redesign your data structure.
ie, you already have an Employees table and a Locations table.
Since you have a many-to-many relationship between these, you would create another table, ie EmployeeLocations, which would contain the primary key from Employees and primary key from Locations.
You could then have as many records in this table as you need for each employee - so it becomes a child table of Employees and a child table of Locations

TheNoLifer
Veteran Member
Posts: 67
Joined: 2015-06-06 12:10

Re: Add additional fields for Lookup

Post by TheNoLifer » 2016-04-07 14:01

Firstly, sorry to revive this topic from the dead - I don't usually dabble in Necromancy, but this is relevant to my issue and I couldn't find a more recent one.

I get the intersection table with the two Primary Keys from the tables, simple to build in the AppGini editor - but how does this actually work in practice within the AppGini app?

Can someone explain the next step for me please? I have a lookup on my "Employees" table and one on my "Locations" table - I'm pretty confused about what happens next - how does this help me with an employee having multiple locations?

Thank you in advance,

A. Dumbass :)

Post Reply