Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Newbie - wrote a script to get sum, count and average of values in any table as selected

2580 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Indresh_Kumar
6 - Interface Innovator
6 - Interface Innovator

I am new to JavaScript, and one of the reasons why I took learning it to use it on airtable.

Often I need to sum, count and averages of values in a table and hold the value in a block for a while for others to see. This can be done using existing blocks but one each for sum, count and average - which is tedious.

This script makes life easier in such cases. It lets user select the field and table, and even filter conditions before summing, counting and averaging them.

I am planning to add error handling. and warnings to this soon.

GitHub link is here: https://github.com/indrex/airtablesum

3 Replies 3
Hady_Abdelnour
6 - Interface Innovator
6 - Interface Innovator

Hey Indresh,

I hope you are fine.
I am trying to use the code you created but for some reason the column remains empty whenever I run the script.

I believe it’s related to this: let filterString = await input.textAsync(“Enter filter option”); // what values to filter with.
I’m not sure what it really means. Can you please explain it?
Hady

It’s the value you want to filter by, example: if you have sales figures from different products and you want to show the sum for only one product, filter by that product name.

Thanks for your reply. I removed the this line because I don’t want to filter by one product, for some reason the column is not filling up whenever I run the script.