calculate the # of related items with specific status
Hello everybody, I'm trying to calculate the # of a related item that have status 1,2,3 etc..
how can i do that ?
-
Hi Fabien,
I think you find many examples in this forum for filtering/counting items by if-conditions.
In general this is the way to do it:var status = @All of your status field name in related app;
var count = 0;
for(var i = 0; i < status.length; i++){
if(status[i] == "1"){
count += 1;
}
};
countIf you want to check for OR conditons (status == "1" OR status == "2" etc):
var status = @All of your status field name in related app;
var count = 0;
for(var i = 0; i < status.length; i++){
if(status[i] == "1" || status == "2" || status == "3"){
count += 1;
}
};
count
Rainer
Please sign in to leave a comment.
Comments
2 comments