# Add Row in different table dynamically

**URL:** <https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560>\
**Category:** Ask the Community\
**Created:** [June 25, 2024, 12:38am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560 "2024-06-25T00:38:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sabbir\_Ahmad](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/sabbir_ahmad/32/39768_2.png) [@Sabbir\_Ahmad](https://connect.superhuman.com/u/Sabbir_Ahmad)\
**Post date:** [June 25, 2024, 12:38am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/1 "2024-06-25T00:38:08Z")

</div>

I want that after pressing submit button, this row’s data will be added to the table using table id/name. But this code gives me the error below. I understand the problem here but How can I make this work so I can add data dynamically to different tables based on their IDs or names?  
AddRow(  
thisRow.[Table Id],  
thisRow.[Table Id].Task,  
thisRow.Task  
)

![Screenshot_9](https://global.discourse-cdn.com/coda1/original/3X/f/a/fab78e2b44cddb5ba7e3425de741c3f26a60814c.png)

---

<div class="post-metadata">

**Author:** ![anon1959570](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon1959570](https://connect.superhuman.com/u/anon1959570)\
**Post date:** [June 25, 2024, 5:41am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/2 "2024-06-25T05:41:24Z")

</div>

Hi @Sabbir_Ahmad

That table ID doesn’t look like a table ID.

A table ID should be something like grid-j49JKTupVT

Second, Coda expects a table but hat you are providing inside the formula is a text value. Coda formula doesn’t know that the text you provided is a table ID but rather just plain text.

---

<div class="post-metadata">

**Author:** ![Sabbir\_Ahmad](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/sabbir_ahmad/32/39768_2.png) [@Sabbir\_Ahmad](https://connect.superhuman.com/u/Sabbir_Ahmad)\
**Post date:** [June 25, 2024, 10:03am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/3 "2024-06-25T10:03:36Z")

</div>

so what’s the way? how can i put table id in a way where coda will accept as table id not as text?

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [June 25, 2024, 12:28pm UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/4 "2024-06-25T12:28:38Z")

</div>

Hi Sabbir,

You need to use the runactions() action. This allows you to string formulas together. You then have an AddRow() for the first table, and an Addrow(0 for the second table.

P

---

<div class="post-metadata">

**Author:** ![joost\_mineur](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/joost_mineur/32/30539_2.png) [@joost\_mineur](https://connect.superhuman.com/u/joost_mineur)\
**Post date:** [July 8, 2024, 11:11am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/5 "2024-07-08T11:11:11Z")

</div>

Hello @Sabbir_Ahmed_C ,  
How many target tables are you going to have?

If it is a limited number, you could use a switch() in your button formula:  
 ![image](https://global.discourse-cdn.com/coda1/original/3X/e/6/e6369b14d5cd3ef9720e8c568c31917e4b0d0c91.png)

If there are going to be lots of tables - or tables that don’t exist yet, it is going to be a bit more complicated, but it can be done: see the answer from Paul Danyliuk on [my question in this community](https://connect.superhuman.com/t/can-you-reference-a-table-in-a-formula/44094)

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [October 6, 2024, 11:12am UTC](https://connect.superhuman.com/t/add-row-in-different-table-dynamically/49560/6 "2024-10-06T11:12:02Z")

</div>

Closed on October 6, 2024, 11:12am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
