Nodered button grey out

Hi,

I want greyout a button while robot is running in nodered. How can I achieve that ?

Thanks in advance

What button? Can you share a picture of it?

I have created this button in nodered and while robot is running in background, user should not be able to click on it.

Send “msg.enabled = false” or “msg.enabled = true” depending on the status you want.
Something like this


The top “out” connecter gets activated when the robot completed successfull
the buttom one, if the robot failed or is not responding … the middle is used for status messages, so by setting it up like this the button will be disabled while running and enabled after success or failure

My flow looks like this–

I’m triggering robot with button. How should I fit above logic in this

Once I click on start button, it should grey out until robot is executed

Thank you

add the 3 function nodes and connect them to the button like i showed

Should I 3 function nodes before my button or after and then RPA robot?

Could you please help me with an example

Thank you

Here is an example

[
    {
        "id": "e9d11b83597bf744",
        "type": "ui_button",
        "z": "562ba6bdfee8207a",
        "name": "",
        "group": "903a6ab8.4f4ca8",
        "order": 5,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Run RPA",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 760,
        "y": 1060,
        "wires": [
            [
                "f4f83075552e5a77"
            ]
        ]
    },
    {
        "id": "f4f83075552e5a77",
        "type": "rpa workflow",
        "z": "562ba6bdfee8207a",
        "queue": "5ce94386320b9ce0bc2c3d07",
        "workflow": "5e0b52194f910e30ce9e3e49",
        "killexisting": false,
        "killallexisting": false,
        "queuename": "",
        "name": "",
        "x": 350,
        "y": 1060,
        "wires": [
            [
                "75c4b222ca9a50bb"
            ],
            [
                "427e112c6c41ca8d"
            ],
            [
                "d7ef6f78a6b20868"
            ]
        ]
    },
    {
        "id": "75c4b222ca9a50bb",
        "type": "function",
        "z": "562ba6bdfee8207a",
        "name": "enable button",
        "func": "msg.enabled = true\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 1020,
        "wires": [
            [
                "e9d11b83597bf744",
                "4121a938316601a5"
            ]
        ]
    },
    {
        "id": "427e112c6c41ca8d",
        "type": "function",
        "z": "562ba6bdfee8207a",
        "name": "disable button",
        "func": "if (msg.command == \"success\" || msg.command == \"idle\" ) {\n    msg.enabled = false\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 1060,
        "wires": [
            [
                "e9d11b83597bf744",
                "13191f469cb4484f"
            ]
        ]
    },
    {
        "id": "d7ef6f78a6b20868",
        "type": "function",
        "z": "562ba6bdfee8207a",
        "name": "enable button",
        "func": "msg.enabled = true\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 1100,
        "wires": [
            [
                "e9d11b83597bf744",
                "5447a9a465392f68"
            ]
        ]
    },
    {
        "id": "4121a938316601a5",
        "type": "debug",
        "z": "562ba6bdfee8207a",
        "name": "debug 11",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 920,
        "y": 1000,
        "wires": []
    },
    {
        "id": "13191f469cb4484f",
        "type": "debug",
        "z": "562ba6bdfee8207a",
        "name": "debug 12",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "command",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 920,
        "y": 1060,
        "wires": []
    },
    {
        "id": "5447a9a465392f68",
        "type": "debug",
        "z": "562ba6bdfee8207a",
        "name": "debug 13",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "error",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 926,
        "y": 1114,
        "wires": []
    },
    {
        "id": "903a6ab8.4f4ca8",
        "type": "ui_group",
        "name": "Home",
        "tab": "e2e6f4f5.56f91",
        "order": 1,
        "disp": false,
        "width": "16",
        "collapse": false,
        "className": ""
    },
    {
        "id": "e2e6f4f5.56f91",
        "type": "ui_tab",
        "name": "Homet",
        "icon": "dashboard",
        "order": 3,
        "disabled": false,
        "hidden": false
    }
]

It worked! Thanks again @Allan_Zimmermann

1 Like

@rehan.quresh and @Allan_Zimmermann
I always wanted to know how to access things like “buttons” when you use node-red-dashboard?

install node-red-dashboard under palette
open dashboard tab
image
and click
image

or simply open /ui in the browser

1 Like

Thanks @Allan_Zimmermann. This will help me a lot. :smiley:

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