Forum Discussion
A-1
It’s safe to say it’s similar, you could achieve similar with the following filter directly on the object (as a bit of a double verification doing both null and empty string checking):
!$.filter((v, k) => v != null && v != "").isEmpty()
A-2
This space and time complexity is fairly low, you’re talking O(n) when it comes to this validation and verification as it will go through every piece in the input document to check for values, we do a filter and length (creates an array and provides us the length of that) to then check for the size, the other option above is similar in that route.
A-3
There are some other ways to potentially do this, but I wouldn’t really call them perfect solutions, your flat file is likely a CSV and as a result, there’s some limitations with the CSV Parser to get those empty rows removed, and I think that’s a place where the snap can potentially be improved (I’ll have a feature request logged internally to see if we can help out in this case). Some of our snaps have better support for this than others, I believe the Excel Parser has some option to exclude empty rows from the output, but that’s using a different way to parse, so it’s slightly skewed in how it operates.
Just so you know, I tested this out and it works as well :+1: