Total Number or Rows in Airtable using blocks

Hi there, hopr you are well.

This is what i’m trying to achieve with Airtable:
Everytime a new record is created in a table, the app checks if the total number of rows is 250, if it’s so, it deletes the oldest entry (the 250th row)
I know it sounds easy, but here the tricky part: the tablename is a variable - and can’t be fixed, because it depends on a result of a qrcode scan.

I’m aware about this block:
image
But here you can’t actually change the tablename once the block is set.

I came up with this solution that actually works okay, but it uses too many API Calls as Airtable just gives you maximum 100 results per page - and as Airtable set a limit, i was wondering if there was an easier solution - as it takes a lot of time performing this action, especially if the table is 3000 rows long.

Is there any easier way to do it?
I mean, i’d need a block like this one
image
But considering the tablename as variable?


Linked to this question, i’d love to know if there is a block performing this action:


As these “airtable1” blocks dont work anymore and, if i’m using API calls, i can just delete a row by its “id number” (something like “cb7dkaacis927ff0”) and not the actual row number, like for example the 250th of the table.

What i’m trying to perform here is to get rid of the 250th row

Sorry if it sounded tricky, but hope you have a smarter solution

Thank you very much for your time

My bad, sorry i forgot to attach the other part of the blocks i’m using now:
Every API call it gets 100 values and one “offset” value which means i need to call an API again with this offset value to get the next 100 values and so on, resulting in too many API calls and endless seconds

So, my questions are:

  • Is there an easier way to detect how many rows an Airtable’s table has, considering that the table is a variable?
  • Is there a way to delete “row number 250”, without knowing the id?

Thank you very much for your help

1 Like

That’s what the built-in “ID” column in the list of values in block is for:

Hello tatiang, thank you for your time replying.

I’m aware of that block, but as you can see in the block you can’t use the tablename as variable

I would need that “Table 1” is a variable

Yes, I wish we could use a variable there.

1 Like

Hi @maurizio.polverini89
It is a great suggestion and will pass it on to the team.