Filter all the "[null]" values

Hello,

I have a dataset (please refer to the screenshot for more info) and want to filter out all of the “[null]” value that there is for the data field “customer”.
The if node does not seem to work.
Any chance I could have some help on this?
Thank you

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Julien_Fontaine,

I would use the if node, Are you able to provide the data in a json format so we can take a look at it as there is no reason why the if node wouldn’t be able to show you all of the records where that value is null.

Thank you Jon for your reply.
I did it the following way and it seems to work.
However, not sure if what I did is best practice

Screenshot 2024-02-08 at 12.19.57

1 Like

Yes that looks good, that’s best practice.

You can also provide default data inline with this neat one liner like this then you won’t need the if node {{ $json.Customer || "John Smith" }}.

The || in code means or. If $json.Customer doesn’t have anything it will return the text next to it

You would use this is there are default values for the fields but would use the if node if you need to take extra steps to get those values

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.