Is there a way to tally (add up) and display customer fields in Trello?
Asked by Tim Boyle:

I am collecting numerical information in the cards, and want to be able to add them up to a total without having to export the data?

Has anyone figured out a way to do this?

Thank you!


Answers:
author: Katrin Anger
body: [@Tim Boyle](/t5/user/viewprofilepage/user-id/3125908)

Hi Tim, yes there is a way to calculate numeric custom fields. Actually, there are two ways.

The first, is setting up a new custom fields that stores the calculated value. And the action for this could look like this:

![Bildschirmfoto 2019-05-03 um 11.11.20.png](https://community.atlassian.com/t5/image/serverpage/image-id/53396iD6C410CABA4BB829/image-dimensions/585x175?v=v2 "Bildschirmfoto 2019-05-03 um 11.11.20.png")

Alternatively, you could store the calculated value in either the description of a card or in a comment.

Setting up the command's action would look like this:

(I made use of only one example here)

![Bildschirmfoto 2019-05-03 um 11.10.46.png](https://community.atlassian.com/t5/image/serverpage/image-id/53397iF71F9C6ED59F58A4/image-dimensions/592x212?v=v2 "Bildschirmfoto 2019-05-03 um 11.10.46.png")

You could even send the result of the calculation off by email (if you have a paid account). And a fourth way would be by using user variables, but that's probably the least comfortable one.

Does that help?

comments: author: Iain Dooley
body: [@Katrin Anger](/t5/user/viewprofilepage/user-id/2708783) that would sum the value of fields on an individual card though... My read of Tim's requirement was to take the value of a field that occurs on multiple cards and present the total.

Could you trigger when a custom field is modified, fetch a "total" card with the current total in it and add the new value set on the card?


author: Katrin Anger
body: [@Tim Boyle](/t5/user/viewprofilepage/user-id/3125908) [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112)

If that's really Tim's requirement than I currently see no other way than setting up user variables on this.

One could add values to card variables, and use them in a calculation.

Even if the value in the custom field changes and the card variable is modified accordingly, the calculation should work.


author: Stephanie McCammon
body: [@Katrin Anger](/t5/user/viewprofilepage/user-id/2708783) Could you give an example of what this would look like? I'm also trying to do what Tim requested. Thanks!


author: Iain Dooley
body: [@Tim Boyle](/t5/user/viewprofilepage/user-id/3125908) as far as I know, the Butler power up doesn't have the ability to loop through all cards in a list and sum the values for a given custom field although [@Oscar Triscon](/t5/user/viewprofilepage/user-id/1124366) or [@Katrin Anger](/t5/user/viewprofilepage/user-id/2708783) would be able to confirm if that's the case.

In the meantime this Trellinator function would set the name of lists to "List Name (XX)" where (XX) is the SUM of all values in the custom field "Something to Tally" whenever a card was moved (it will update the names of the list the card was moved out of as well as the list the card was moved into):

<https://gist.github.com/iaindooley/86df7a00c2052c9af7cfad948244a9a5>

Obviously you might need to tweak that to suit your specific use case. You can see more about Trellinator here:

<https://community.atlassian.com/t5/Marketplace-Apps-articles/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271>


Tags: butler

calculation

custom-field