How to save to related table

Hi, I have a form that I want to use to save data to two tables. I have a vendor request form table and a comments table. The tables are related with each vendor request having multiple comments. I only need to generate one comment when this form is submitted (additional comments to be added by other forms). I can create an action to save to the request form table but have not determine how to save the comments table data at the same time. How can I do this?

Thank you

.

Hi @Matt-1edd :smiley:

For this, you would add another step to the automation on the "Submit" button to add a row to the second table:

Also, you'll want to have ID column to uniquely identity each request. (Make the first column in your Vendor Request table an ID column). This allows you to associate the different comments in the second table to that ID, by writing the request ID to that table as well. This is how the tables would look:

Here is the Comments table, which writes the comment, the request ID, and time submitted (by writing NOW()):

And here's the Vendor Requests table with the first column being a request ID. I also added a Comments column with a FILTER of all of the related comments:

=FILTER(Comments,"Comments[RequestID]=[RequestID]")

If you want to have auto-incremented IDs for each new request, here's an article that can help you set that up: Build a Unique Row ID Automation

Hope this helps! Let us know if you have any other questions. :slight_smile: