# Can't change the button properties (bgcolor, label, etc.)

**URL:** <https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975>\
**Category:** Dashboard\
**Created:** [4 August 2019 00:11 UTC](https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975 "2019-08-04T00:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FufsowyFufs](https://avatars.discourse-cdn.com/v4/letter/f/c5a1d2/32.png) [@FufsowyFufs](https://discourse.nodered.org/u/FufsowyFufs)\
**Post date:** [4 August 2019 00:11 UTC](https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975/1 "2019-08-04T00:11:42Z")

</div>

I've recently started creating my first flow and I've hit a problem. Basically what I want to do is to change the bg color of a button. I wanted to do it using the msg.ui\_control, but when I attempted to do so it wouldn't work.

I've created a simple flow to recreate the problem:

```auto
[{"id":"ac95c9f4.899c48","type":"ui_button","z":"e152864.d557c78","name":"","group":"c15f4537.459f28","order":1,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"Green","icon":"","payload":"","payloadType":"str","topic":"","x":610,"y":200,"wires":[[]]},{"id":"13f4b7a2.5a1828","type":"inject","z":"e152864.d557c78","name":"Red","topic":"","payload":"{\"bgcolor\":\"Red\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":200,"wires":[["562d6254.c9b78c"]]},{"id":"562d6254.c9b78c","type":"change","z":"e152864.d557c78","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ui_control","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":200,"wires":[["ac95c9f4.899c48"]]},{"id":"6d51a19b.96029","type":"inject","z":"e152864.d557c78","name":"#FF0000","topic":"","payload":"{\"bgcolor\":\"#FF0000\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":240,"wires":[["562d6254.c9b78c"]]},{"id":"8901e7a1.808b48","type":"inject","z":"e152864.d557c78","name":"#ff0000","topic":"","payload":"{\"bgcolor\":\"#ff0000\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":280,"wires":[["562d6254.c9b78c"]]},{"id":"c15f4537.459f28","type":"ui_group","z":"","name":"Group","tab":"9cc02838.aaeca8","order":1,"disp":false,"width":"6","collapse":false},{"id":"9cc02838.aaeca8","type":"ui_tab","z":"","name":"Test","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/28eb88042a1bd3ce5178e93c3539e6fb88a8e923.png)

 ![test](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/71cdc7f034306eabf9633cf2fc9b0ebfcc5add3f.gif)

It's probably a dummy mistake I made, but if you know the solution to this problem, please respond.

Best Regards,  
Fufs

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [4 August 2019 05:41 UTC](https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975/2 "2019-08-04T05:41:40Z")

</div>

Did you read the info panel ?

> Allows dynamic control of the Dashboard.  
> The default function is to change the currently displayed tab. `msg.payload` should either be an object of the form `{"tab":"my_tab_name"}` , or just be the **tab name** or **numeric index** (from 0) of the tab or link to be displayed.  
> Sending a blank tab name "" will refresh the current page. You can also send "+1" for next tab and "-1" for previous tab.

Search: "[Change button background color](https://discourse.nodered.org/search?q=Change%20button%20background%20color)" as we see this question here every week.

---

<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:** [4 August 2019 07:01 UTC](https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975/3 "2019-08-04T07:01:05Z")

</div>

Hi @FufsowyFufs, welcome to the forum.

You'll find the folk here very helpful but we really appreciate a good topic and correctly formatted code.

When you post code or a flow please put three back ticks on a line above and below, like this...  
`````  
`code here`  
`````

Secondly, a more appropriate topic title really helps the right forum member understand if they can help. For example, this topic should probably be titled "can't change button background colour".

Anyhow, a quick search lead to [this](https://discourse.nodered.org/t/examples-of-colour-change-button-and-switch/3650). Might be helpful?

---

<div class="post-metadata">

**Author:** ![FufsowyFufs](https://avatars.discourse-cdn.com/v4/letter/f/c5a1d2/32.png) [@FufsowyFufs](https://discourse.nodered.org/u/FufsowyFufs)\
**Post date:** [4 August 2019 09:26 UTC](https://discourse.nodered.org/t/cant-change-the-button-properties-bgcolor-label-etc/13975/4 "2019-08-04T09:26:54Z")

</div>

Hi,  
Sorry, I was really frustrated with it. I read the config-fields.md file on Github and thought this was the way to go. When I tried to research the problem, I was looking for ui\_control information. Now I see I was mistaken. Thanks for the help. I'm gonna change the post now to help others find the problem. Appreciate the help.

Best Regards,  
Fufs
