Hide missing values (unprocessed)

I have a JSON, and sometimes this is missing values (missing element from JSON).
I tried the following and none is working:

  • hide-block-if(value==null)
  • hide-block-if-empty
  • collapse

A example JSON is in the attachment.
Result unprocessed
Example.js (25.6 KB)

Hi @nataliWinOn365,

You don't necessary need to use the "hide-block-if-nothing" formatter if the token is missing. You'll have an empty field in the result document just using the token {{value}} and if the token is not specified in the JSON it will be removed from the result document.

On the other hand, if you want to hide a full table row, it won't work and left the row with an empty cell.

Please clarify if you need to hide a full row in case some of the cells values are missing in the JSON?

Best regards,
Petr
Plumsail team

I don't want to hide the full table, just don't show any value. I always get unprocessed for the lines, which have no value.

Hi @nataliWinOn365,

Try to use only a token without the hide-block formatter and use it with the curly brackets {{}}. Currently, there are this square brackets

So, use a token like this: {{entries.Category.WO_name}}.

It will leave a cell empty if there are a missing token in the Json.

Best regards,
Petr
Plumsail team

Thanks for the feedback.
The printscreen that you saw, was the output, not the template. The problem was with the comparison ({{entries.tkp_includeDeposit}:hide-block-if(value == True)} ). As I was still getting errors, I've chosen to use a workaround.

1 Like