Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I validate if the JSON object is not empty? Currently, I am processing the data[] array and it is inserting values in DB. If its a blank, then, it inserts a NULL. How can I achieve this?
Correct JSON:
{
"RESULT_1": {
"data": [
["0", null, "12345", "other"],
["1", "a", "54321", "MA"],
["0", null, "76543", "RI"]
]
}
}
Empty JSON:
{
"RESULT_1": {
"data": [ ]
}
}
Thanks!
Hello,
Have you tried to replace your empty/null field with "Null" string?
Such as:
output_row.output = input_row.output.replaceAll(",\"[a-zA-Z][a-zA-Z]*\":\\[\\]", "Null"); in tJavaRow.
Best regards
Sabrina
Hello,
It will check empty values in your JSON file.
Best regards
Sabrina