Equivalent of a “find records” step in scripting for more than 100 records based on criteria?

136 5
Showing results for 
Search instead for 
Did you mean: 

Hi, I’m trying to make a script that counts the number of records based on the date created field. I don’t need any other information, just a count and would prefer not to have to make a view since my base is already cluttered. Any help would be greatly appreciated!

5 Replies 5

Hi @Kim_Zhou,
If you group by Date Airtable automatically shows you the count.

What is your level of scripting experience?

This thread has some scripts for counting the records in a table. However, if you want to count only records that meet a condition, you will have to add that logic in. These scripts were also not designed for automation scripts, so the output would also need to be adjusted for an automation.

Counting bases by date created can be a little tricky because the created time field actually has a time as well as a date, even if you do not display it.

Thank you! I am brand new to Airtable scripting. Do you have any examples of what that logic would look like?

That logic would need to be done entirely in JavaScript.
You will need to get the value of the date field by using record.getCellValue().
You might want to turn the ISO string from the cell value into a JavaScript date object.
From there, it is a matter of date manipulation and comparison and array filtering in JavaScript.
If you are brand new to JavaScript as in addition to being new to Airtable scripting, it it might be a bit of a learning curve to put it all together.