Automate Population of Junction Table (with delete feature)

I have a simple script I’m trying to write, but since I’m new it’s not simple to me… LOL

I have a junction table I’d like to automatically populate. In this example

  • I want to connect every bug with every home. So anytime a bug is added to the Bug Table, the junction table is updated to connect it with every home.

  • Likewise, whenever a Home is created, the junction table is updated with every bug.

  • Lastly, I want the script to clear any junction records if either a bug or home is deleted.

I started with the script from this thread HERE, but just couldn’t figure out how to modify it to make it work.
Lollipops for anyone who can help me! Thanks. :slight_smile:

Would love a little help with this, if anyone wants has a minute. :hugs: :green_heart:

The script didn’t come through with your example base, but I can copy it easily enough from the thread that you linked. However, my big question is this: would you like to run this script manually (via a Script app), or automatically (via an automation)? The latter option will actually require some new code, and would result in a total of three automations.

I wish this were a quick fix, but because of the amount of time required to write the new code, modify the existing code, and test everything to match your criteria (it’s not as simple of a script as one might assume), I would need those lollipops you offered to be the type accepted as currency by most banking institutions. :slight_smile: DM me if you want to proceed.

Thank you so much for the reply. This is what I ended up with, after hiring some help from a script writer.