# Local DB / How to add new row?

**URL:** <https://community.thunkable.com/t/local-db-how-to-add-new-row/126564>\
**Category:** Questions about Thunkable X\
**Tags:** database\
**Created:** [June 30, 2019, 2:53pm UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564 "2019-06-30T14:53:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonym247](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/anonym247/32/36129_2.png) [@anonym247](https://community.thunkable.com/u/anonym247)\
**Post date:** [June 30, 2019, 2:53pm UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/1 "2019-06-30T14:53:33Z")

</div>

Hi everyone. I want to make a “Contacts” app. Which has a simple database (“Local DB”) table “contacts” and which contains of 2 columns. “Name” and “Number”. Very simple yeah…

There is problem when i want to “Add new contact”.

There is my algoritm.

## WHEN Button1 Click do { in “contacts” set (Cell) column -\> 1 row -\> in “contacts” get “NumberOfRows” + 1 value -\> from TextInput1 get Text

in “contacts” set (Cell)  
column -\> 2  
row -\> in “contacts” get “NumberOfRows” + 1  
value -\> from TextInput2 get Text  
}

Application doesnt give an error. But it doesnt create new row on database…

Please dont advise me use Spreadsheet Airtable or Firebase. I must do this in Local DB (offline). Without any online databases.

Thank YOU!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 1, 2019, 8:46am UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/2 "2019-07-01T08:46:48Z")

</div>

Hi,

Local DB has no blocks for dynamically changing the structure of the table at the program execution stage. Therefore, you need to create as many empty lines in the Local DB as you need in the designer. To do this in Excel, select the desired number of empty rows and insert them into the table. Before adding a new record to the table, you must find the index of the first empty rows.

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a506a4f9e5a63e1303a175f16ac8750d936b4c26.png)

Another way is to use the list and store it in the local storage using a variable of “storage” type or the Local Storage block of the local storage.

---

<div class="post-metadata">

**Author:** ![anonym247](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/anonym247/32/36129_2.png) [@anonym247](https://community.thunkable.com/u/anonym247)\
**Post date:** [July 1, 2019, 9:14am UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/3 "2019-07-01T09:14:56Z")

</div>

Thank you sir!

---

<div class="post-metadata">

**Author:** ![mbv.charanqe65ap](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mbv.charanqe65ap](https://community.thunkable.com/u/mbv.charanqe65ap)\
**Post date:** [July 21, 2019, 2:08am UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/4 "2019-07-21T02:08:58Z")

</div>

hi will you please help in linking photos to each contact or row for before excel file.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 21, 2019, 6:24pm UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/5 "2019-07-21T18:24:38Z")

</div>

Sorry, but I did not understand your question. If you need to copy data from Excel into a table, then in Excel you create all the fields and links to the url of the images.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:12pm UTC](https://community.thunkable.com/t/local-db-how-to-add-new-row/126564/6 "2024-11-08T12:12:07Z")

</div>


