# Adding a like button to data viewer grid

**URL:** <https://community.thunkable.com/t/adding-a-like-button-to-data-viewer-grid/1981809>\
**Category:** Questions about Thunkable X\
**Tags:** data-viewer\
**Created:** [July 31, 2022, 9:05pm UTC](https://community.thunkable.com/t/adding-a-like-button-to-data-viewer-grid/1981809 "2022-07-31T21:05:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prez523kthzh9](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@prez523kthzh9](https://community.thunkable.com/u/prez523kthzh9)\
**Post date:** [July 31, 2022, 9:05pm UTC](https://community.thunkable.com/t/adding-a-like-button-to-data-viewer-grid/1981809/1 "2022-07-31T21:05:44Z")

</div>

I managed to make a like button but I’m having trouble with the code.

* * *

The data for the data viewer is from an air table. Here is what it looks like:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/5879773021810c4cdbac0248371677a73126eee5.png)

When the user presses the like button on a post in the data viewer the number of likes of the post should increase by 1 and add the row id, image, username, and context of the liked post from the airtable to the local database.

Here is how the local database looks:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/d/edd7c6cc1f9d9a79e092dbf7916e7fd086ed74c7.png)

What’s going wrong:

- when I press the like button the likes increase by 2.
- I’m also having trouble deleting a liked post from the local database when the user presses the likes button again because I have no idea how to access the row ID in the local database that contains an Airtables row id. (i thought it would make sense to put the Airtable id and local DB id in one cell so i could access them more easily but I think it just complicated it more…? )

I wasn’t able to screenshot the code however here is the link for the app:  
[https://x.thunkable.com/copy/779ecc0ee014e3f1cf4350c602adfa28](https://x.thunkable.com/copy/779ecc0ee014e3f1cf4350c602adfa28)

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![ioannisroungeris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannisroungeris/32/109459_2.png) [@ioannisroungeris](https://community.thunkable.com/u/ioannisroungeris)\
**Post date:** [August 1, 2022, 11:48am UTC](https://community.thunkable.com/t/adding-a-like-button-to-data-viewer-grid/1981809/2 "2022-08-01T11:48:31Z")

</div>

Hello,  
I looked a lit bit into your app.  
Why do you need the local database? I think it complicates the whole thing.  
If you want to update the airtable you can do it directly using this block [https://docs.thunkable.com/spreadsheet](https://docs.thunkable.com/spreadsheet)

If you still want to use the local DB I think you should save also the Airtable id so that you can make changes.

If you need help impliment the Airtable component please let me know

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [October 30, 2022, 11:48am UTC](https://community.thunkable.com/t/adding-a-like-button-to-data-viewer-grid/1981809/3 "2022-10-30T11:48:44Z")

</div>

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