cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
frankvanesch-
Frequent Visitor

Count items in Array in Object

Hi,

 

I'm trying to count the items in the array "Count" for Each "Allowance2". Can someone give me advise how to fix this? 

 

This is my input. 

{
    "body": [
        {
            "Allowance2""A",
            "Count": [
                {
                    "Allowance": {
                        "Value""A"
                    }
                },
                {
                    "Allowance": {
                        "Value""A"
                    }
                },
                {
                    "Allowance": {
                        "Value""A"
                    }
                }
            ],
            "Person""User1"
        },
        {
            "Allowance2""B",
            "Count": [
                {
                    "Allowance": {
                        "Value""B"
                    }
                },
                {
                    "Allowance": {
                        "Value""B"
                    }
                }
            ],
            "Person""User1"
        }
    ]
}
 
This is the desired output.
 
Person: User1
Allowance2: A
Count: 3
 
Person: User 1
Allowance2: B
Count: 2
1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Like this:

CountAllowance.png

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

View solution in original post

2 REPLIES 2
Paulie78
Super User
Super User

Like this:

CountAllowance.png

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

frankvanesch-
Frequent Visitor

Thanks you so much, you made my day!

Helpful resources

Top Solution Authors
Users online (4,186)