Glide Pages forms - one to many relations

Hi, Gliders,

I need some suggestions for creating a multi-step form container within a form container for Glide Pages.

Scenario:

  • An Event Manager wants to add 2 events to an event calendar.
  • The Spring Festival is Saturday and Sunday, March 19 and 20.
  • The Fall Festival is Saturday and Sunday, October 15 and 16.

I need a form that allows:

  • Add the new event Spring Festival (a few fields such as event name, address, description, etc. written to an event table)
  • Add a date (related to event name, add start date time and end date time written to a calendar table)
  • Add ANOTHER date to capture the second day of the same event.
  • SUBMIT that one event with BOTH of its dates.
  • Add ANOTHER EVENT to repeat the process for the Fall Festival and its two calendar dates.

Concerns:

  • I need the event form to be the parent of the calendar form as the child.
  • The calendar form needs to autofill the event name to build the relation between event name and calendar dates.

I welcome ideas and suggestions.

Thanks!

I think the easiest way is to build a custom form. @Darren_Murphy has a great write up, but the one thing to remember is that the User Profile table is accessible from everywhere and its data can be used to pass data through a form submission, or through an Add Row action at any time in the process.

Here’s what I would do:

  • Create several user-specific columns in your Users table to store the first couple sets of information (new event details, dates, etc.)
  • Once all that info is in the Users table, create an action that writes it to whichever other tables it needs to exist in — you’ll already have all the info you need to build the relations after the rows are added (you can add several Add Row actions to add data to multiple tables at the same time).
  • The last part of this action should be to clear all the user-specific columns so that they’re empty in the Users table. This way, the same user can start the process again without any of the old data sticking around.

Here’s a link to Darren’s original post with more info: How do I create a custom form?

1 Like

My alternative method to @kyleheney is:

  • Add a user-specific “Calendar ID” column to your User Profiles table.

  • Upon opening the form to add an event calendar: if the Calendar ID is empty, set a unique identifier to the signed-in user’s “Calendar ID” column then open the form, else just open the form.

  • In the form, you allow the user to add any information needed for the event calendar, then have a form button to allow users to add child events. That form will get the event name, start date & end date, then when you submit it, record the “Calendar ID” as a column, to create the relation.

  • Back to the event calendar form, submit as any events as you want, then when you submit the event calendar form, submit the “Calendar ID” as a column. Then you have a one-to-many relation from the event calendar to its child events. Once the event calendar is submitted, add an “on submit” action to clear the “Calendar ID” column so it’s ready for the next iteration.

The downside to this is that you will have to copy the components from one form to another form, since the logic below means 2 branches of logic, hence 2 forms.

2 Likes

Both good options. Just to clarify, the spring AND fall events need to be scheduled in the same form?

1 Like

This is a good question. Adding it in the event calendar’s details view after the event calendar has been added is much easier.

I don’t think it is so much about the form–it is about loading the info to the right table WITH its one to many relation. I have a google sheet of event details and a google sheet of calendar dates. They are linked by event name. The result (which is accessed by Glide Apps) is three tabs of Event List, Map, and Calendar. All of those allow access to the same details page that tells you all about the event including a complete calendar of days. My examples were one weekend each, but others might be a monthly or weekly craft fair or farmer’s market with 12 or 52 calendar dates.

I think it needs to be a primary form container for event details to create one row on Event Details sheet with a secondary form container for calendar dates to create multiple rows in the Calendar sheet. That’s what I’m trying to understand/design.

I don’t know if my logic is correct to design it. But it must be ONE row for an event with MULTIPLE rows for dates tied together through the relation of event name.

The most straightforward way is simply to use a form to write a new event record. On form submission, set the action to show details screen. Then, have a form button the details screen of the event to add calendar dates.

No great way to do this otherwise given that calendar dates can range from one to many.

I’ve been watching @Darren_Alderman video building a customized form and he uses a container. However, I see there is a choice of container or FORM container. Other than the obvious implication of using one for forms, how do they work differently and why choose one over the other?

A regular container allows you to contain/group multiple components and thus apply visibility conditions to the entire set of components at once.

A form container is a special kind of container that acts EXACTLY like a form button, but it’s in line with other components on the page.

Regular containers don’t have submit/cancel buttons.

3 Likes

Unless you are absolutely sure there will never be duplicates, this is not a good practice in my opinion. I almost always use unique identifiers/rowIDs.

I definitely use Row IDs–in fact, Glide won’t let me build what I’m building without adding it. But the calendar sheet also has row IDs. Not familiar with using the row ID as the relation field. Would I simply copy the Event row ID into the calendar sheet (which is what I do now with the event name). I would still want to see the event name in the calendar sheet for my own sanity as I manage the sheets over time. Would I create a lookup column in the calendar sheet to pull in that event name?

Sounds like you’re using user-specific columns in a Google Sheet table.

I assume the Event sheet is the “parent” one, the Calendar Dates sheet is the child. Then for every calendar date, you would want to have the event ID written in there.

Then, in Glide, create a relation using the event ID from the Calendar Dates sheet to the Event sheet, and a lookup to retrieve the Event Name.

Oh, Great Gliders @ThinhDinh @Robert_Petitto and @kyleheney. I’m so grateful for your continued suggestions. I have been playing with a free version of Glide Pages all weekend. I have had several “aha moments” realizing how Pages works, but I just possibly had a huge realization and come back to you for confirmation. Apologies in advance for the very long post.

Unless there is something I am missing in different tools and features in a paid version, it seems that Pages is just not meant to be a front-facing program like Apps is. As I viewed Glide’s marketing and announcement items, I inferred that it would be a no-code “pretty” website, but I just can’t make it work like that.

Everything I am trying and every container/component/option I use seems to be for data entry, data review or data editing as a database management tool. Which is fine and useful…just not going to accomplish what I want.

My App is called Festival Chasers with main tabs for Events, Map, and Calendar:

All tabs eventually lead to individual event detail screens:

My ultimate goal with Pages was to allow event managers (of which there could be hundreds) to upload and manage their own event listings in a desktop environment. A secondary goal was that the listings could appear visually as they do in the App.

The event managers will NOT want to manage their events by typing with their thumbs on their phones. I now believe that my only options are

  • steer event managers to use the App interface on their computers in order to use mouse and keyboard for data entry.
  • develop something in Google Forms and find some way to feed it into the App’s Google Sheets.

Thank you, again, for your kind and generous support to all new Gliders through this forum.