Checking JSON if array is empt

Hi there,

Before I state my question I will sketch the problem a bit.

For the Home Assistant I use the shopping list integration. Now when I enter specific zones I receive a message with the shopping list. That all works fine. But now I want only send the message when the shopping list is not empty.

I was thinking to check the JSON file and check if the array is empty.

My question is how do I do this? Can I fix this with a template or something else?

Also, if you have a better solution to check if the list is empty please let me know.

Thanks in advance!

have you ever managed to get this working? i was looking for similar functionality tbh