Counting number of related apps
AnsweredI would like to have a calculation field that shows the number of items in another app that are related to this item.
The calculation field provides Sum, Average, Max, Min of a field in another app, but what I want is a Count.
Any built in ways to do this or a suggested javascript that can count the number of items in another app related to the item in the app (where the calculation field resides)?
-
Official comment
Hi Art,
Pick any of the "[ ] All of X" for the desired relation. (That will return a list of X for all the related items). Type ".length" after that to get the length of the list.
The entire script should end up like "@All of Title.length" and return a number.
Comment actions -
Hi Art,
you will need to add an additional calc-field to the items you want to count. Then have that field always output 1. Now you can count these items by summing over that field in the original app.
Does that make sense?
Here is a calculation that always outputs 1:
var foo = @AnyField; // only needed because otherwise Podio will not let us save the template
1;That's it. Now use this to count the items in that other app.
Best,
Stefan
Please sign in to leave a comment.
Comments
4 comments