# New Window with msg.payload

**URL:** <https://discourse.nodered.org/t/new-window-with-msg-payload/3726>\
**Category:** Dashboard\
**Created:** [5 October 2018 23:12 UTC](https://discourse.nodered.org/t/new-window-with-msg-payload/3726 "2018-10-05T23:12:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanjohnson00](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ryanjohnson00/32/2956_2.png) [@ryanjohnson00](https://discourse.nodered.org/u/ryanjohnson00)\
**Post date:** [5 October 2018 23:12 UTC](https://discourse.nodered.org/t/new-window-with-msg-payload/3726/1 "2018-10-05T23:12:57Z")

</div>

This seems so easy but I have not been able to figure it out.

I want to open a new window showing my msg.payload. The msg.payload is XML data so formatting it would be nice.

One of two ways.

1. I have a dropdown and when that changes open the new window with XML data
2. Have a button, when it is clicked it opens a new window of XML data

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 October 2018 23:58 UTC](https://discourse.nodered.org/t/new-window-with-msg-payload/3726/2 "2018-10-05T23:58:06Z")

</div>

What have you tried?

Are you trying to open a new browser window automatically when a message is sent? You need to remember that, while you are accessing the node-red admin ui probably in the same browser, the flow is not running in the browser (front-end), it is running on the server (back-end). Two completely different contexts.

So to affect the front-end (browser) from the back-end (server), you need firstly to have a front-end app and secondly for that app to receive a message from the back-end. This is what Dashboard does.

However, Dashboard has its own limitations. It is a Single-page App (SPA). so you can't really open a "new window". But what you can do is use the Dashboard control node to switch to a different _tab_ - assuming you already have the dashboard loaded.

---

<div class="post-metadata">

**Author:** ![ryanjohnson00](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ryanjohnson00/32/2956_2.png) [@ryanjohnson00](https://discourse.nodered.org/u/ryanjohnson00)\
**Post date:** [6 October 2018 00:27 UTC](https://discourse.nodered.org/t/new-window-with-msg-payload/3726/3 "2018-10-06T00:27:55Z")

</div>

When I make a selection it queries a database and retrieves the XML data. I want to then open the file so a user can view it. This XML data is currently in my payload from the query.

A couple weeks ago I had the template open a new window using HTML and JavaScript but I switched how I was dealing with data at that time and did not save the template. I will continue to research how I opened a window. I was hoping someone did this already and I am just overlooking some obvious way to do it.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [6 October 2018 09:43 UTC](https://discourse.nodered.org/t/new-window-with-msg-payload/3726/4 "2018-10-06T09:43:50Z")

</div>

No, front-end JavaScript is undoubtedly the best way if you really want a new Window.
