# outputLabels based on UI props doesn't get refreshed until UNDO

**URL:** <https://discourse.nodered.org/t/outputlabels-based-on-ui-props-doesnt-get-refreshed-until-undo/33408>\
**Category:** Developing Nodes\
**Created:** [27 September 2020 13:04 UTC](https://discourse.nodered.org/t/outputlabels-based-on-ui-props-doesnt-get-refreshed-until-undo/33408 "2020-09-27T13:04:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pitus/32/28170_2.png) [@pitus](https://discourse.nodered.org/u/pitus)\
**Post date:** [27 September 2020 13:04 UTC](https://discourse.nodered.org/t/outputlabels-based-on-ui-props-doesnt-get-refreshed-until-undo/33408/1 "2020-09-27T13:04:21Z")

</div>

This is a weird behavior I just encountered with my custom node that needs to control the number of its outputs depending on users data entered in the editor UI.

I've added `outputs` as well as `outputLabels` into the `defaults` so that I can set their values from `oneditsave` and the `outputs` one behaves as expected - the node changes the number of outputs properly.

However the `outputLabels` array that I wanted to match the # of outputs needed, doesn't change at all, even after a reload of the page - all output tooltips (on hover) show the old, default values, even after editing the node.  
I've verified that the `outputLabels` array is properly set in `oneditsave`, however the node seems to be caching its output labels somewhere else and using the old set ... until I hit CTRL+Z (UNDO) which magically fixes the problem and all output labels now appear to be correct, even after subsequent reloads!

So UNDO seems to clear some kind of a cache, yet it doesn't actually undo my last edit, as if something has pushed an extra change into UNDO History ?

P.S. Discovered the UNDO thing by accident - trying to change some properties to force an update, but then wanted to revert these changes and noticed the labels being correct, but changes not being undone, had to hit UNDO again for that. When I tried to reproduce this process to describe it here in detail, I noticed that the UNDO actually does revert my changes but no longer fixes the output labels.  
Deploying the flow and reloading, then making the change and an UNDO fixes output labels again and does actually UNDO my change too... So this appears to be some kind of an interaction between the loaded internal state vs the UI update of `outputLabels` and UNDO ?

---

<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:** [26 November 2020 13:04 UTC](https://discourse.nodered.org/t/outputlabels-based-on-ui-props-doesnt-get-refreshed-until-undo/33408/2 "2020-11-26T13:04:30Z")

</div>

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