# Link in the stats node

**URL:** <https://discourse.nodered.org/t/link-in-the-stats-node/83015>\
**Category:** General\
**Tags:** flexdash\
**Created:** [19 November 2023 18:57 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015 "2023-11-19T18:57:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)\
**Post date:** [19 November 2023 18:57 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015/1 "2023-11-19T18:57:49Z")

</div>

Hey it's me again🙈  
I'm trying to put a link in the stats node.  
But working with the change node and doing this  
"\< hef="{{msg.link}}" target="\_blank" rel="noopener noreferrer"\>{{msg.payload}}\</"a" \>"  
doesn't work, is that even possible?

 ![Screenshot_20231119_195623_Opera](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d18222060827c1ed2406146afc0d63938795235d.jpeg)  
 ![Screenshot_20231119_195716_Opera](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/350671df553bdfd59eb239f3c723875d8a89b01a.jpeg)

---

<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 November 2023 20:22 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015/2 "2023-11-19T20:22:37Z")

</div>

Yes, in a change node use JSONata or use a template node  
example flow

```auto
[{"id":"215c7b5140159f2d","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"link","v":"www.google.com","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"www.msn.com","payloadType":"str","x":340,"y":1400,"wires":[["496f648e34957cd7","ebe19130c9e5cdcb"]]},{"id":"496f648e34957cd7","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"'< hef=\"' & $$.link & '\" target=\"_blank\" rel=\"noopener noreferrer\">' & $$.payload & '</a>'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":1380,"wires":[["2b701357156994b7"]]},{"id":"ebe19130c9e5cdcb","type":"template","z":"d1395164b4eec73e","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"< hef=\"{{{link}}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{{payload}}}</a>","output":"str","x":520,"y":1440,"wires":[["2b701357156994b7"]]},{"id":"2b701357156994b7","type":"debug","z":"d1395164b4eec73e","name":"debug 2456","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":1340,"wires":[]}]

```

JSONata

```auto
'< hef="' & $$.link & '" target="_blank" rel="noopener noreferrer">' & $$.payload & '</a>'

```

Template mustache

```auto
< hef="{{{link}}}" target="_blank" rel="noopener noreferrer">{{{payload}}}</a>

```

---

<div class="post-metadata">

**Author:** ![Panda](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@Panda](https://discourse.nodered.org/u/Panda)\
**Post date:** [19 November 2023 21:26 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015/3 "2023-11-19T21:26:06Z")

</div>

Thx for your help but unfortunately, it doesn't work.  
The top one is the tamplate node, the other the change node.  
Maybe you're swapping it, but it's not about the node red ui it's about the flexdash.

 ![Screenshot_20231119_222124_Opera](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/5/c52bface47ec3d54577110b45224343d4ddd7324.jpeg)

---

<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 November 2023 22:04 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015/4 "2023-11-19T22:04:15Z")

</div>

Not a flexdash user, but i think flexdash uses R markdown  
I think the html `< > ` are replaced, so displays the full text not the href link.  
You could try this

> <https://stackoverflow.com/questions/29787850/how-do-i-add-a-url-to-r-markdown>

---

<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:** [18 January 2024 22:04 UTC](https://discourse.nodered.org/t/link-in-the-stats-node/83015/5 "2024-01-18T22:04:43Z")

</div>

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