# Template node widget output on click - Json for ui control

**URL:** https://discourse.nodered.org/t/template-node-widget-output-on-click-json-for-ui-control/73889
**Category:** General
**Created:** [18 January 2023 20:53 UTC](https://discourse.nodered.org/t/template-node-widget-output-on-click-json-for-ui-control/73889 "2023-01-18T20:53:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Vilnis\_R](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vilnis\_R](https://discourse.nodered.org/u/Vilnis_R)
#### Post date: [18 January 2023 20:53 UTC](https://discourse.nodered.org/t/template-node-widget-output-on-click-json-for-ui-control/73889/1 "2023-01-18T20:53:32Z")

</div>

Hi,  
I have template node widgets with some data to display in Dashboard Home Tab. They also could serve as buttons to jump on other tabs where I put Back buttons to return at Home. There are no problems with button nodes to return.  
However I can not find right syntax for template nodes click event. I was trying to send like:  
ng-click="send({payload: '{tab:Tablet}'})" but obviously this is a String not an Json Object to be accepted by ui control node.  
Here is an example of one widget.

```auto
<md-button class="vibrate filled touched bigfont rounded" style="background-color:#c0392b" ng-click="send({payload: '??'})"> 
<i class="fa fa-thermometer-half fa-2x" style="color:{{msg.payload.Trend}}"></i>
    &nbsp&nbsp{{msg.payload.TopR || '?'}}&#176C<br/><br/>{{msg.payload.Bottom || '?'}}&brvbar{{msg.payload.Middle || '?'}}&brvbar{{msg.payload.TopR || '?'}}
</md-button>

```

What could be the easiest solution here?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [19 January 2023 08:08 UTC](https://discourse.nodered.org/t/template-node-widget-output-on-click-json-for-ui-control/73889/2 "2023-01-19T08:08:20Z")

</div>

> [@Vilnis\_R](#):
>
> ng-click="send({payload: '{tab:Tablet}'})"

```auto
ng-click="send({payload: {'tab':'Tablet'}})"

```

Then don't send a payload string, send an object.

---

<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: [2 February 2023 08:08 UTC](https://discourse.nodered.org/t/template-node-widget-output-on-click-json-for-ui-control/73889/3 "2023-02-02T08:08:57Z")

</div>

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