Forum Discussion
I KEEP getting the null:
But i did figure out how to show first day of last month and last day of last month!
It is because the COUNT is an integer, try with this:
"0000000000".slice($COUNT.toString().length) + $COUNT
- SpiroTaleski4 years agoValued Contributor
That is happening because the output of the Union Snap will produce multiple documents(from both inputs). And some of the documents does not contains the value that you are referring to, which throws an error.
By checking the “null safe acess” in the mapper snap will prevent the error, and on the output of the mapper snap you will have the same number of documents as input. The documents that does not contains the path that you are referring will have “null” value on output.
BR,
Spiro Taleski - alex_panganiban4 years agoContributor
I think as an alternative to using the null safe access feature, you could also use the hasPath() and get() methods. I like using the get() a little more because if the path doesn’t exist, then it will automatically assign a null to the result of the expression, whereas the hasPath() method renders a true or false result. If you use hasPath(), then you’ll probably want to incorporate it as part of a ternary expression.
Here’s a few conceptual examples for you.
- SGArchitect4 years agoNew Contributor II
Thank you, Spiro
Related Content
- 2 years ago
- 2 years ago