# Setting this.credentials.someKey = undefined has no affect

**URL:** <https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971>\
**Category:** Developing Nodes\
**Created:** [30 December 2022 22:06 UTC](https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971 "2022-12-30T22:06:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 December 2022 22:06 UTC](https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971/1 "2022-12-30T22:06:03Z")

</div>

So...  
I have some very specific value handling (I am migrating a sizeable project to Typescript)  
I am using a configuration node for most of my configuration.

In this config, I have some value manipulation on the `oneditsave` handler, that handles the UI element if the value is \< 1 in length (my UI elements do not follow the naming convention)

I therefor handle them my self (as I need to use `undefined`)

All this works well!

Apart from those properties that are attached to `credentials`  
setting these to `undefined` has no affect - I instead need to set them as a space `' '` - for Node RED to render them as `undefined`

for sake of clarity is this by design or am I missing something?  
if that is to be expected. - then cool, just want to make sure I understand this requirement to clear them out.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 December 2022 22:47 UTC](https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971/2 "2022-12-30T22:47:14Z")

</div>

I'm not sure we've ever had to handle that precise scenarios before, so I wouldn't say the current behaviour is "intended"... but if that is what works for you...

Can you raise an issue with details as it sounds like we should be doing better.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [30 December 2022 22:51 UTC](https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971/3 "2022-12-30T22:51:24Z")

</div>

Thanks @knolleary

I will get it raised soon.  
I'll let the new year begin first 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 February 2023 22:51 UTC](https://discourse.nodered.org/t/setting-this-credentials-somekey-undefined-has-no-affect/72971/4 "2023-02-28T22:51:25Z")

</div>

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