Forum Discussion
6 Replies
- GayathryNew Contributor II
Thanks Bojan for your quick reply.
Actually as per my requirement inside ‘group’ if getting a empty list ‘{}’, it should return false . But group.lengh is returning true even if list is empty(ie {}).
eg:
if JSON is like below it should return false.
“group”: [
{}
]- bojanvelevskiValued Contributor
@Gayathry, go with the following expression:
$group.filter(x=>x.hasPath('ID')).length > 0
- darshthakkarValued Contributor
@bojanvelevski: Thank you for sharing this.
Can we check if the incoming JSON is empty or not using the same?Thanks.