[Solved] Display Sum (total) of a Airtable column in a label

Hello,
I want to display the total of a column from Airtable. Named Fees… And length of the same Column in another label…
How should I do this?

Thanks😉

1 Like

Hi there,

You can get the Column from Airtable and save it as a list (example from docs). For this let’s say you saved it as a variable called thisList, and that your total is called thisTotal.

To get the total, you want blocks that say
set thisTotal to 0
For each item j in list thisList,
thisTotal = thisTotal + j

Then display thisTotal on a Label.

Is there a chance that the column you get from Airtable will have blank cells in it?

Thanks,
Jane

2 Likes

@jane, Thanks for your Reply :smile:

I didn’t get this code… What’s this code for? (total of list or sum of list?)

No. The column is named : Fees

Thanks :smile:

2 Likes

The first block is to get the sum of the list.
You can find the ‘for each item in list’ block in the ‘Control’ drawer of blocks.

If none of the cells will be empty, then you can use the ‘length of list’ block from the List drawer of blocks to get the length of the list. :grin:

1 Like

Thanks :wink:

2 Likes