Null and undefined in string fields

Describe the problem/error/question

Null

When I set a string field as null, I get a string “null”.
What I expect: receive null value, not a string. By the way, for string or boolean fields I get null as expected.

This is especially bad for using ternar operator where I receive “null” if null.

Undefined

The same with undefined. In 0.236.0 when I defined a string field with a non-existent value to a string, nothing happened. I used this to check if the prop was defined.
In 1,8 2 a field with “undefined” string value is created. Why, it shouldn’t be like that.

Screenshots for undefined

0.236.0

1.8.2

Please share your workflow

Process for null

Share the output returned by the last node

[
  {
    "null string": "null",
    "null boolean": null
  }
]

Information on your n8n setup

  • n8n version: 1.8.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker-compose
  • Operating system: Ubuntu 22

Hey @artildo,

Internally for the string we will try to convert the value as we are expecting it to be a string, We should probably not do that for null / undefined. I will get a dev ticket created now for a future change.

Internal dev ticket is NODE-824

2 Likes

Hey @Jon, thank you. Would be fine. I know people who spent hours trying to figure out where these “undefined” strings came from.

For now I use either Set nodes in JSON form or Code nodes to treat null and non-existent strings as usual.

Hey @artildo,

Oddly enough I have not seen anyone else report it, Where are the folk who spent hours trying to firgure it out posting about it?

@Jon In the Telegram-community Telegram: Contact @n8n_community
and in private messages followed after I reported it there

1 Like

Interesting, Just think it could have been solved a lot quicker if they used an official community :smiley:

I waited 2 days because of weekend :slight_smile:
Sometimes it’s quicker to receive the support there.

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