I have a one-to-many relationship setup that I need to reverse. Is this possible?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have a table called Offers and a table called Hosting Requests. Right now, I can relate one offer to many hosting requests. I need to do the opposite - relate one hosting request to many offers. Is this possible? Thank you!

Photo of Karen

Karen

  • 222 Points 100 badge 2x thumb

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Yes, you will need to change this to a many to many relationship.  One Offer has Many Offer Hosting Requests and One Hosting Request has many Offer Hosting Requests.  The Offer Hosting Request table is the "join" table.

Once you have that middle talbe set up, you should be able to copy your records from the current child table to the join table.  

The Related Offer field will map into the Related Offer field in the join table and the Record ID will map into the [Related Hosting] field on the join table.  The will probably be not other fields copies into the join table.

Then you will want to delete the direct relationship between offers and Hostings. I suggest you make a Copy of your app before making these changes,
Photo of Karen

Karen

  • 222 Points 100 badge 2x thumb
Thanks Mark! Do I need to set it up this way even if I don't need the current relationship? I don't need it to be many to many. Just one to many, but the opposite of how it is now (It is A:B and I need B:A) Thanks!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Oh sorry. I assumed you needed many to many. Just delete the relationship you have and rebuild it.