Help

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

2539 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Kim_Zhou
6 - Interface Innovator
6 - Interface Innovator

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.
image

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.

@Kim_Zhou

As @Vivid-Squid mentioned above, you can just group by date and Airtable will show you the count of the number of records.

However, it sounds like you are looking for some automated way of doing this that doesn’t require scripting?

If so, this can be done extremely easily using Make.comeven if your found count is greater than 100 records. And this doesn’t require any scripting at all.

All you have to do is use a “search records” module, and it will return the “Total Number of Bundles” for you to use in any subsequent steps.

As far as I know, Zapier cannot do this. This is one of the many things that only Make can do but Zapier cannot do. And none of it requires any programming code or knowledge of JavaScript.

You just need to use the “search records” module, as seen in the screenshot below. One simple step, and then all future steps will be able to use the total record count — even if the found count in greater than 100.

This is completely free and it only uses up one automation run.

Note that when you setup your Search Records module, you need to tell it the “maximum” number of records that you want it to return to you. So you could just set it to a very high number like 10,000 or 50,000. It will still only use up one automation run — but you’re just telling it the maximum number of records that you want it to return.

Screen Shot 2022-09-15 at 2.49.28 PM