# Msg.params from ui\_control node

**URL:** https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907
**Category:** General
**Created:** [15 April 2020 20:51 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907 "2020-04-15T20:51:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [15 April 2020 20:51 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/1 "2020-04-15T20:51:10Z")

</div>

I notice that if I deploy a ui\_control node and open the dashboard using a url such as  
`http://localhost:1880/ui/#!/0?socketid=&fred=hello&jim=42`  
that I get two messages from the ui\_control node. The first is the connect message, which is followed by a change tab event message and the message has an attribute `params` which contains  
`{ fred: "hello", jim: "42"}`  
Is that intended behaviour and can I rely on it working? I would like to use it for various devious purposes.  
In particular I would like different devices to go to different tabs on startup, and to preload some fields with values, which I believe I can do by using different parameters in the url.  
I don't think there is another way of achieving that is there?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [15 April 2020 21:25 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/2 "2020-04-15T21:25:49Z")

</div>

Yes - was added last year

> [@Can we pass-in URL parameters to a dashboard?](https://discourse.nodered.org/t/can-we-pass-in-url-parameters-to-a-dashboard/10138/10):
>
> This would be a great idea, I have the same need. I would like to be able to directly call the dashboard url and pass query parameters in the url...

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [16 April 2020 08:25 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/3 "2020-04-16T08:25:34Z")

</div>

Oh yes, I missed that, thanks. Is it documented anywhere? I notice it is a bit picky in how the url is formatted. So this works  
[http://host.name:1880/ui/#!/0?fred=hello](http://host.name:1880/ui/#!/0?fred=hello)  
but this doesn't  
[http://host.name:1880/ui/?fred=hello](http://host.name:1880/ui/?fred=hello)

Also the fact that when using a ui\_control to change the tab if msg.socketid is set then the tab is only changed for the connection with that socket id doesn't seem to be documented in the info panel or the readme. Unless I missed it.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [16 April 2020 08:41 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/4 "2020-04-16T08:41:47Z")

</div>

We just use the angular $location.search() - so that is what it gives us... I'm guessing it expects proper angular urls. As you know - I'm always happy to have PRs for improving docs.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [16 April 2020 10:32 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/5 "2020-04-16T10:32:08Z")

</div>

OK, thanks.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [15 June 2020 10:42 UTC](https://discourse.nodered.org/t/msg-params-from-ui-control-node/24907/6 "2020-06-15T10:42:36Z")

</div>

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