Adding a like button to data viewer grid

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:

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

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

Any help would be appreciated.

1 Like

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

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

2 Likes