# 'widget-action' messages set msg.topic to 'undefined' (updated)

**URL:** https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683
**Category:** Developing Nodes
**Tags:** node-red-dashboard, dashboard-2
**Created:** [21 April 2025 14:57 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683 "2025-04-21T14:57:46Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [21 April 2025 14:57 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/1 "2025-04-21T14:57:46Z")

</div>

I have upgraded my dashboard-2 to v1.23.0.

In my custom UI node, when I send messages as 'widget-action' (`this.$socket.emit('widget-action', this.id, msg)` ), their `topic` property is getting overrun and becomes `undefined`.

This happens also in the generic `ui-template` node. Using `this.send(msg)` works OK, but using `emit` to `'widget-action'` overwrites the `topic` property.  
For example, I inject a msg with `msg.topic='myTopic'`to the template:

```auto
mounted() {
	const $scope = this;

	// Socket listener
	this.$socket.on('msg-input:' + this.id, function(msg) {

		msg.payload = "Using 'emit'";
		$scope.$socket.emit('widget-action', $scope.id, msg);

		msg.payload = "Using 'send'";
		$scope.send(msg)
	});
}

```

and get the following result:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d9e9defa026afad4102cbbd47ae9470a1ce406ea.png)

@joepavitt - any ideas? this was not happening in earlier dashboard versions.

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [25 April 2025 09:25 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/2 "2025-04-25T09:25:46Z")

</div>

Can you open an issue on the GH repo if you haven't already please @omrid, I know that @Steve-Mcl recently modified some topic-based code for the UI Form, but not sure if that's related.

---

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [25 April 2025 09:36 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/3 "2025-04-25T09:36:52Z")

</div>

Thanks, I have opened an issue (#1683).

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [25 April 2025 09:43 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/4 "2025-04-25T09:43:55Z")

</div>

Thanks @omrid - just linking to it so that it's easier for future navigation: [‘widget-action’ messages set msg.topic to ‘undefined’ · Issue #1683 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/1683)

---

<div class="post-metadata">

### Author: ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)
#### Post date: [12 May 2025 15:09 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/5 "2025-05-12T15:09:08Z")

</div>

Hi @joepavitt, @Steve-Mcl,  
I see that dashboard v1.24.0 has been released, with issue [1683](https://github.com/FlowFuse/node-red-dashboard/issues/1683) not resolved yet.

Is there any projected date for the fix? (It's OK if not in priority, I just need to know, as I will have to modify my custom UI node to stop using the `topic` property)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [12 May 2025 15:11 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/6 "2025-05-12T15:11:23Z")

</div>

That release was for an immediate need we had - sorry it did not include a fix for this one. It will be picked up in due course 🤞

---

<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: [11 July 2025 15:11 UTC](https://discourse.nodered.org/t/widget-action-messages-set-msg-topic-to-undefined-updated/96683/7 "2025-07-11T15:11:48Z")

</div>

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