How to get amount of non empty slots in an array?

Hi. I need to get amount of non empty elements of an array. How would I achieve this ?

Thanks I made just like you said and it worked. I got my inventory slots array than connected it to a for each loop and connected array element to a is valid class node and than did math from there.

What is it an array of?

If its Actors or other Objects you can do a for each loop and count the number of invalid elements.