Add a new row with relation to a parent row

Hi,

I’m fairly new Glide, so I hope I’m not asking a too silly question !

I want to be able create a new record from Glide pages (via a form button for example), and automatically populate some relation fields when the form is submitted.

Simple example:

  • I have a Company Table
  • I have a Contact Table
  • Both these tables are coming from Airtable sync
  • I want to be able to create a contact with these information: First Name, Last Name, Email, Company (relation to Company table)

When I try to build the form, I notice that the Edit components don’t contain any “Relation Input” option.
I tried with a Choice component, that lists all the available Companies from a Contact form, but I’m not able to to use it to map to the right company when submitting and triggering the “Add a row” action,

Of course, the easy solution is to create the record and make the relationship between Contact and Account directly from Airtable but I want to make that feature available to my future app users

Please, let me know if this requires more precision !
Thank s!

A relation in Glide is a computed column, so it’s not something that you would ever add data to with a form. As long as the relation is correctly configured, whenever you add new data the relation will automatically be formed - as long as the new row creates a match.

In your case, it sounds like you should be including a Company ID or Company Name in your Contact Table and adding that when creating new rows.

That said, I’m not an AirTable user, so I’m not aware if there might be special handling required when working with AirTable and relations. @Robert_Petitto would know more about this.

1 Like

OK good to know @Darren_Murphy about automatic relation when adding new child records.
However, I suspect my issue is related to an Airtable limitation…none of my Airtable Relationship fields are available

I assume the issue is that you’re unable to write to a link field in AT?

Yes exactly @Darren_Murphy seems it’s a known limitation

Exactly. It’s the one reason why I don’t use AT more as a base. AT’s super power is the link field which Glide sees as read only.

1 Like

Yep I agree, unfortunately my base was originally in AT…
Do we know if there are some improvements planned on this ?

In the meantime, would you have a good workaround to still allow my users to create Contacts with Companies from Glide ?

I’m thinking of this (after a few searches in google):

  • Create a Choice component on the Contact detail page to list all available Companies
  • Update a Text column (synced with AT) based on the Choice value selection (copy the selected Company Airtable ID value for example)
  • Have an automation in Airtable that looks for the right company based on the previous text value and update the AT Linked field with the result

(Just realized I have your Youtube Video about row owners and roles on another tab…thanks so much for your work :slight_smile: )

I’m also encountering this limitation. I found you workaround with an AT automation which is slow but works well (thanks).
May I ask what do you use instead of AT in Glide ? Glide tables ?
But what if you need to connect several appls to the same database ?
I guess it’s not possible when using Glide tables ?

You can connect multiple apps to the same glide table.