# Template node msg.payload

**URL:** <https://discourse.nodered.org/t/template-node-msg-payload/94254>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [30 December 2024 12:11 UTC](https://discourse.nodered.org/t/template-node-msg-payload/94254 "2024-12-30T12:11:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerrybartley](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerrybartley/32/67495_2.png) [@gerrybartley](https://discourse.nodered.org/u/gerrybartley)\
**Post date:** [30 December 2024 12:11 UTC](https://discourse.nodered.org/t/template-node-msg-payload/94254/1 "2024-12-30T12:11:05Z")

</div>

Can I pass msg.payload to ui-template in Dashboard 2?  
When the user selects an option from a dropdown I set msg.payload to true. I want to pass this to the template so that the overlay appears. When the data returns I set the payload to false and pass it to template to hide the overlay

The examples I've looked at all involve a control defined within the template

I took the template code from the Vuetify site

```auto
<template>
  <div class="text-center">
    
    <v-overlay
      :model-value="overlay"
      class="align-center justify-center"
    >
      <v-progress-circular
        color="primary"
        size="64"
        indeterminate
      ></v-progress-circular>
    </v-overlay>
  </div>
</template>
<script>
  export default {
    data: () => ({
      overlay: false,
    }),

    watch: {
      overlay (val) {
        val && setTimeout(() => {
          this.overlay = false
        }, 3000)
      },
    },
  }
</script>

```

---

<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:** [30 December 2024 12:34 UTC](https://discourse.nodered.org/t/template-node-msg-payload/94254/2 "2024-12-30T12:34:21Z")

</div>

> [@gerrybartley](#):
>
> Can I pass msg.payload to ui-template in Dashboard 2?

msg is already available. You can use a watch on msg and you can access it via `this.msg`.

This is all documented in the online docs: [Template ui-template | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html#receiving-data)

---

<div class="post-metadata">

**Author:** ![gerrybartley](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerrybartley/32/67495_2.png) [@gerrybartley](https://discourse.nodered.org/u/gerrybartley)\
**Post date:** [30 December 2024 13:40 UTC](https://discourse.nodered.org/t/template-node-msg-payload/94254/3 "2024-12-30T13:40:56Z")

</div>

Yes. Works a treat. As always read the manual!!!!  
Thanks for that

---

<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:** [13 January 2025 13:41 UTC](https://discourse.nodered.org/t/template-node-msg-payload/94254/4 "2025-01-13T13:41:49Z")

</div>

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