Associating data with new rows

I’m absolutely stumped and would welcome any help.

I have a sheet (“Groups”) that collects data (from a Glide Form) about groups that meets every week for X weeks. So, the “Group” sheet gathers things like (a) the name of the group, (b) the day it meets, (c) the time it meets, etc.

Each of those groups needs to be associated with certain weeks on the “Weeks” sheet. That sheet keeps track of unique data for each week (e.g., description of the week, week number, etc.). Also, the Weeks sheet is dynamically updated. So, it is important that the Groups be associated with the Weeks that are active at the time the Group is created.

I need each Group, when created from the form, to be associated with certain, (currently “active”) weeks on the “Weeks” sheet.

Ideally, this would create an additional sheet with two columns (“GroupID” and “WeekID”) and would have an entry for every week that Group is associated with. However, I’ve been unable to figure out to add, say, 15 new entries to the sheet to represent the 15 weeks that Group is associated with. Ideally, with each new Group, it would add entries like

  1. Group1ID, Week1ID
  2. Group1ID, Week2ID
  3. Group1ID, Week3ID
    etc.

Is there a way to write these rows to the sheet? Or is there a better way to associate these weeks (which are sourced from a dynamically updated sheet) with each Group?

Can anyone help?

So when you add a new group you want to add 15 rows that are associated with that group, each representing 1 week.

Yes. Right now, I haven’t been able to think of another way to do it.

I can’t simply associate the Group with the Weeks because the Weeks will dynamically update. But I need to preserve the historical record of which Weeks each Group is associated with. So I need a table that preserves those associations.

Is there a better way to do this?

Thanks for any help or insight you can provide.