[Solved] How to delete a row from airtable when using a filtered list to view data? or How to find the Airtable row number for items in a filtered list?

Currently, my users are able to call the data that they have submitted to my database. Their view only permits the user to seee their data and no other users. The data are displayed in the listviewer.

I am wondering what blocks I would use for a user to be able to click on an item in the listviewr and have that deleted from the Airtable.

Here are the blocks I use to populate the users data

this is the screen produced by the blocks. <edit: I should state that this is a filtered list and the airtable includes data for other users as well and for the same user for different measures.>

A link to the ‘playground’ testing app:
https://x.thunkable.com/copy/2f7d02da63b932ccbfe2a82245bfb810

THis is where i get stuck:

I want to add blocks that would allow the user to click one of the list items to allow for it to be deleted from the Airtable spreadsheet. Can anyone help me with this?? Please and Thank you! (I would also not mind just being directed to a tutorial that can advise on how to find the row number for items in a filtered list)

Pretty sure you just need to drag the green index block down to rowNum to attach it.

this would work, however the list i am would be viewing does not correspond with all of the rows in the database because the lilst viewer is essentially filtered data.

what occurs is multiple users are sending in data to my Airtable DB. i need this for my purposes. Then they are needing to be able to edit/delete/update datat they have submitted in case of an accidental submission or error etc. so I am able to recall just specific user data and put this into a list view. however, I am unable to figure out how to delete only that row.

Thank you! I just tried your suggestion, @tatiang. but unfortunately…

When i did this, i clicked the first item in my listviewer. this deleted the first row in the airtable but if you read above, you will understand why this doesnt work. the first row i see in my airtable doesnt correspond with the first row i will see in my listviewer.

Okay, so if it’s partial data then you need to have a unique identifier for each user, something like an ID number. You would assign a random ID when the first row is created in the table and save it to the app. You’d also place the ID in a column of the table for that user.

When the user wants to delete their row, you would search the column for their ID and delete the row at that index.

@tatiang, thank you. currently I use the firebase sign in method, so in practice all usernames are unique. Also, each user will have multiple entries. So searching for the unique is also doesn’t work. It Would sharing A screenshot of my airtable help?

I am having ideas come together. if create a new ‘id’ column and assign a random number to each row (each entry from any user), what blocks would i use to then search for that specific row?

something like this? in this example, the item clicked would be the unique row _id displayed from the json that airtable produces

![Screen Shot 2019-12-26 at 8.21.13 PM|690x300(upload://iOTi7QthoYeNKYEMb06S056eTp0.png)

Does this sound on track?

Create unique id column

Get column block
Set variable templist to column
Search for first instance of unique id

How do I get the number of that item?

Your screenshot didn’t show up so it’s a little hard to know for sure how you have it set up.

I haven’t used Firebase but as far as Airtable is concerned, I did a search by looping over the table from i to length of list[column] using the Spreadsheet call GetColumn and then checking to see if searchTerm = cellValue. If it does, then I know that i is the row containing the match.

I can post a screenshot if you like. I didn’t because I’m using some list variables and other variables along with Airtable so it’s not a straightforward set of blocks to explain what I just wrote above.

Hi @joannietw & @tatiang . I figured it made sense to loop you both in here as this will be the most up to date info for my issue and you have been helping which i greatly appreciate!

app link: Thunkable

***attempting to find the true row number (the airtable row number) for a list of filtered data. each row has a unique id. I want the user to be specific types of able to see data they have submitted, and then be able to delete entries if needed. eventually i would like to be able to modify them also but this all relys on being able to figure out the correct row number.

My hope for this small app is to have the Airtable row number display in that label for any list item i click on. then i can take the concept and put it into my bigger app. if it would be helpful to see the bigger app i can share that too.

here are my current screenshots of what i have progressed to. I think i’m on the right track. I have assigned each row a unique id.

now i can display the filtered data in the list showing each unique id. i then try to pull the id from the list and search the colum ‘id’ for that. while doing that i try to loop the var ‘rownum’ to change by 1 each time the column cell doesnt equal the id from the listitem. now all i get is a rising number each time that i click a list item.

These app screenshots actually count sequentially but did not load sequentially

@tatiang Thank you! I know troubleshooting can be difficult! @domhnallohanlon was kind enough to reach out and provide some support today! I have reached a success point and am able to delete the rows that I want to and finally understand that process.

my next problem is that when i delete an issue, the listviewer doesn’t update, it takes clicking button 2 a couple times. however i haven’t dug into the forum to find an answer for that.

1 Like

Part of the problem with troubleshooting spreadsheet features is that we don’t have access to your spreadsheet. The project appears complete except for the API key which is empty. So I’m having to go by the blocks themselves without the benefit of testing everything. Everything looks okay but I know that’s not very helpful to you!

1 Like