# Add Row in Custom Action

**URL:** <https://community.glideapps.com/t/add-row-in-custom-action/43428>\
**Category:** Ask for Help\
**Created:** [June 24, 2022, 12:17am UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428 "2022-06-24T00:17:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rleinen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rleinen/32/43270_2.png) [@rleinen](https://community.glideapps.com/u/rleinen)\
**Post date:** [June 24, 2022, 12:17am UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/1 "2022-06-24T00:17:59Z")

</div>

Is it possible to choose “Add Row” in a custom action and then use the new RowID from that row to add another row in a different table? If so, how would that work?

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [June 24, 2022, 12:32am UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/2 "2022-06-24T00:32:26Z")

</div>

I struggled with this because I bet you want to reference back to the new object/row.

I ended up using @Robert_Petitto technique for creating your own “form add” with the twist that I create a “uniqueID” and store it in the “working table” before collecting the input. Then I used the uniqueID as the identifier instead of the RowID.

I use it in about 10 relations to track interconnections between meetings/feedback/agendas/tasks/posts etc and it works well.

Hope this makes sense.

---

<div class="post-metadata">

**Author:** ![rleinen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rleinen/32/43270_2.png) [@rleinen](https://community.glideapps.com/u/rleinen)\
**Post date:** [June 24, 2022, 12:43am UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/3 "2022-06-24T00:43:54Z")

</div>

Thanks Matt. I’m not quite sure what you’re saying. Here are some more specifics of what I’m trying to do:

1. I have a conference, people and attendees table (with the attendees as the join between conference and people)
2. On the conference screen I have an add attendee button which opens an attendee form. This has a choice component to select a person.

But I want to add a button on that screen to add a new person, capture the rowid of the new person and add it to the attendee table for the given conference.

Does that make sense? Any suggestions?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 24, 2022, 1:00am UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/4 "2022-06-24T01:00:50Z")

</div>

> [@MattLB](#):
>
> I ended up using @Robert_Petitto technique for creating your own “form add” with the twist that I create a “uniqueID” and store it in the “working table” before collecting the input. Then I used the uniqueID as the identifier instead of the RowID.

This is exactly what I do whenever I need to create a parent record, and add one or more child records in the same step.

---

<div class="post-metadata">

**Author:** ![Rimatcom](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rimatcom/32/32285_2.png) [@Rimatcom](https://community.glideapps.com/u/Rimatcom)\
**Post date:** [November 14, 2023, 1:07pm UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/5 "2023-11-14T13:07:22Z")

</div>

Could you leave here the link to that solution? Is what I’m trying to do but without more information is not possible to follow your logic.

Thanks

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [November 14, 2023, 3:46pm UTC](https://community.glideapps.com/t/add-row-in-custom-action/43428/6 "2023-11-14T15:46:56Z")

</div>

## There is no link to the solution - hopefully this makes sense. Plus @Robert_Petitto has an excellent video on working tables.

Here is the technique based on the original example:

There are 3 tables (People, Conference, Attendee). Attendee table has two columns: People-ID and Conference-ID. Currently People-ID is the ROW ID from the People table.

The goal is to Create a new “People” row and Add that “People” to the Attendee table all from one screen. Basically, Add Row to People table (creating a new ROW ID) then Add Row to Attendee table (using the ROW ID from newly created row within the People table).

Problem:

You can not capture the ROW ID for a newly created row (People) during an action. So you can not use the People ROW ID when you Add Row to the Attendee table.

Solution:  
DO NOT use ROW ID as the Identifier for a PERSON in the People table, CREATE your own identifier using Glide’s built-in “Unique identifier” field.

This requires setting up a ‘working table’ (which has all the fields of the People table PLUS a new column called “People ID”). Before calling the ‘Show/Edit Screen’ assign a Unique Identifier to the working table’s “People ID” column via Set Col Value. Use this working table as the ‘Data’ for the new screen.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/1/f18d2146e9164af7538a5898d2213ad28e6bcc00.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/0/a00f5588aee4553d22982b51d2613a03461728a2.png)

Technique:

The steps are:

- Create a temporary working table for People (e.g. temp-People table)
- Setup a Button Action which:  
\*\* Set Column Value for People-ID in temp-People table to “Unique Identifier”  
\*\* Show New Screen using temp-People table
- Collect Data for new People into the temp-People table (it already has a People-ID populated)
- Create New ROW in People (Set Col Val with the data from temp-People table including People-ID)
- Create New Attendee Row - Use People-ID from the working table as the People-ID in the Attendee table (replaces ROW ID)

You do not use People table ROW-ID to connect People to a Conference in the Attendee table; you use a unique identifier called People-ID from the working table.

Net/Net: You create your OWN “ROW ID” using "Unique Identifier’ and then set the column value in People Table and Attendee table to that value.
