02-14-2022 01:34 AM
Hello, I need to check if there is no actual data after reading and parsing a CSV file, I am using the CSV Parser and have checked the ‘Contains Header’ (as we will always have a row with headers), I then follow it with a Mapper. If we have no data at this point we need to stop processing and go down a different route. I’m struggling with how after the Mapper, I check if no data is present in my document ($). We have a router snap next and have tried the following options, but none seem to work in the expression window:-
$ == null
$.isEmpty()
Any help appreciated.
Thanks
Mike
02-14-2022 05:00 AM
Glad that it is working now. But the reason why !$.isEmpty()
doesn’t work it’s because:
{}
, the expression !$.isEmpty()
will return false because you are checking first if the input is empty ( which is true ) but you are making it false ( with the !
sign ) and in the end the Router won’t output anything. It’s essentially like saying "Check if input is empty, and if it is, stop the flow of the data ( which in this case it should continue to another output instead of stopping )."
true
and will output the data on the second output view. With the First match
option checked, only the first expression that returns true will be evaluated to the output even if there are more expressions that return true.02-15-2022 04:26 AM
Smashing thanks for the additional information, good knowledge to know.