Support Questions

Find answers, ask questions, and share your expertise

How to check if JSON content is null (or empty)?


HI All,

does anybody know how to check if the content of the file is null or empty? (JSON for example)?




Expert Contributor

Hi @Rosa Negra

I only have experience concerning JSON.

In my opinion it depends what the content looks like.

If the content of an empty JSON is [ ] the flowfile disappears when I do a SplitJson with JsonPath Expression value $.

If the content looks like this [ { } ] I check with RouteOnContent on this (^\[\{\}\]) and filter the file out.


@ Justen my JSON file is being converted to null (file size iz 4bytes) after wrong JOLT is applied.

So, when I open the JSON it's litterally 'null'. There are no brackets.. just null. 110204-1565167770957.png

Expert Contributor

@Rosa Negra
In this case I would use RouteOnContent to check null and maybe additionally check filesize to be on the safe side.


@Justen Thanks!110230-1565168780528.png


@ Justen i believe this is the answer:



The above question and the entire response thread below were originally posted in the Community Help track. On Wed Aug 7 18:53 UTC 2019, a member of the HCC moderation staff moved it to the Data Ingestion & Streaming track. The Community Help Track is intended for questions about using the HCC site itself.

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

New Contributor

To check null in JavaScript, use triple equals operator(===) or Object is() method. If you want to use method then you two arguments.


1)  Pass your variable value with a null value.

2) The null value itself.


To find the difference between null and undefined, use the triple equality operator or Object is() method.


To loosely check if the variable is null, use a double equality operator(==). The double equality operator can not tell the difference between null and undefined, so it counts as same. So if you want to strict check, then don't use a double equality operator. It will lead to misconclusion.