# Use msg.payload.data in template inside \<script\> tag

**URL:** <https://discourse.nodered.org/t/use-msg-payload-data-in-template-inside-script-tag/80204>\
**Category:** General\
**Created:** [1 August 2023 07:43 UTC](https://discourse.nodered.org/t/use-msg-payload-data-in-template-inside-script-tag/80204 "2023-08-01T07:43:10Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [1 August 2023 08:51 UTC](https://discourse.nodered.org/t/use-msg-payload-data-in-template-inside-script-tag/80204/5 "2023-08-01T08:51:21Z")

</div>

> [@Hans4711](#):
>
> it is about, how can I pass values (array) from payload.series + payload.labels to js script tag (apex chart option section) to achive this:

that is exactly what the 3 examples I gave you do - that pass something from server side (node-red runtime) to the template in the client side (aka dashboard) - you have to determine what to do with the data.

Pick any one of the examples I offered and add `alert(msg)` inside the `watch` and you will see that data is being passed from Node-RED to Dashboard.

If you want a particular example based on apex - forum search reveals some clues

- [Apex Chart with Customization](https://discourse.nodered.org/t/apex-chart-with-customization/77207)

---

_[View the full topic](https://discourse.nodered.org/t/use-msg-payload-data-in-template-inside-script-tag/80204)._
