How to count element of json response from API

Hi all

I have question about count element of json response from API

i have json with struct like image bellow

Now i want to count all element with Sex is Men or Women,someone help me how to implement it in outsystem

Thanks

Hi Tung Nguyen,

Have you tried JSON Deserialize. It will convert your json string to outsystems object. Once you get the data into a record list so you easily get count. Please try and let me know. 


-Hitesh-

Hitesh Maran wrote:

Hi Tung Nguyen,

Have you tried JSON Deserialize. It will convert your json string to outsystems object. Once you get the data into a record list so you easily get count. Please try and let me know. 


-Hitesh-

Hi @Hitesh Maran 

thanks for your suggest but what is function support count total element of list with specify condition 


Hi Tung,

You can filter the list for specific condition using list filter.Then you can get the count of the element in the filtered list.

Regards,

Koushik

Hi Tung Nguyen,

Please find the sample on how to count the no of items from json with filter condition . I have added comment to the function. Please check and let me know.


Pranav Pandey wrote:

Hi Tung Nguyen,

Please find the sample on how to count the no of items from json with filter condition . I have added comment to the function. Please check and let me know.



Thanks so much

it worked

Solution

Tung Nguyen wrote:

Pranav Pandey wrote:

Hi Tung Nguyen,

Please find the sample on how to count the no of items from json with filter condition . I have added comment to the function. Please check and let me know.



Thanks so much

it worked

Happy Coding  :)


Solution