Struggling with JSON Data

I'm new to JSON and struggling. I have a dashboard form that collects an integer and stores it in JSON. I need to extract the integer so I can use it. I'm failing miserably.

Please help

Here's my flow

[
    {
        "id": "24bd94a6ca28cffd",
        "type": "ui_text",
        "z": "cb58b0f2ac83d096",
        "group": "3d153cb1a380b89c",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Brightness Level",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "",
        "x": 910,
        "y": 300,
        "wires": []
    },
    {
        "id": "1adcbd7787bbc99e",
        "type": "ui_form",
        "z": "cb58b0f2ac83d096",
        "name": "",
        "label": "deskBrightness",
        "group": "3d153cb1a380b89c",
        "order": 5,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "deskBrightness",
                "value": "deskBrightness",
                "type": "number",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "deskBrightness": ""
        },
        "payload": "",
        "submit": "submit",
        "cancel": "",
        "topic": "payload",
        "topicType": "msg",
        "splitLayout": "",
        "className": "",
        "x": 640,
        "y": 160,
        "wires": [
            [
                "24bd94a6ca28cffd",
                "4efa61ae4de6cc01",
                "77d66229b27cca54",
                "13aa0c22eb6bcabb",
                "3ab83c4d2a526220"
            ]
        ]
    },
    {
        "id": "a1daf67020415503",
        "type": "inject",
        "z": "cb58b0f2ac83d096",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "3",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "8",
        "payloadType": "num",
        "x": 450,
        "y": 160,
        "wires": [
            [
                "1adcbd7787bbc99e"
            ]
        ]
    },
    {
        "id": "3ab83c4d2a526220",
        "type": "debug",
        "z": "cb58b0f2ac83d096",
        "name": "debug 165",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1170,
        "y": 140,
        "wires": []
    },
    {
        "id": "4efa61ae4de6cc01",
        "type": "json",
        "z": "cb58b0f2ac83d096",
        "name": "JS Object",
        "property": "payload",
        "action": "obj",
        "pretty": false,
        "x": 880,
        "y": 220,
        "wires": [
            [
                "3ab83c4d2a526220"
            ]
        ]
    },
    {
        "id": "77d66229b27cca54",
        "type": "json",
        "z": "cb58b0f2ac83d096",
        "name": "string & Object",
        "property": "payload",
        "action": "",
        "pretty": true,
        "x": 900,
        "y": 60,
        "wires": [
            [
                "3ab83c4d2a526220"
            ]
        ]
    },
    {
        "id": "13aa0c22eb6bcabb",
        "type": "json",
        "z": "cb58b0f2ac83d096",
        "name": "JSON String",
        "property": "payload",
        "action": "str",
        "pretty": true,
        "x": 910,
        "y": 120,
        "wires": [
            [
                "3ab83c4d2a526220"
            ]
        ]
    },
    {
        "id": "3d153cb1a380b89c",
        "type": "ui_group",
        "name": "LED Switch",
        "tab": "c548a45fe690539c",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "c548a45fe690539c",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": true
    }
]

The deskbrightness is at path
msg.payload.deskBrightness
eg

[{"id":"a1daf67020415503","type":"inject","z":"eb90474bf03634f2","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"8","payloadType":"num","x":100,"y":220,"wires":[["1adcbd7787bbc99e"]]},{"id":"1adcbd7787bbc99e","type":"ui_form","z":"eb90474bf03634f2","name":"","label":"deskBrightness","group":"8b5cde76.edd58","order":5,"width":0,"height":0,"options":[{"label":"deskBrightness","value":"deskBrightness","type":"number","required":true,"rows":null}],"formValue":{"deskBrightness":""},"payload":"","submit":"submit","cancel":"","topic":"payload","topicType":"msg","splitLayout":"","className":"","x":300,"y":200,"wires":[["24bd94a6ca28cffd","3ab83c4d2a526220"]]},{"id":"24bd94a6ca28cffd","type":"ui_text","z":"eb90474bf03634f2","group":"8b5cde76.edd58","order":6,"width":0,"height":0,"name":"","label":"Brightness Level","format":"{{msg.payload.deskBrightness}}","layout":"row-spread","className":"","x":560,"y":360,"wires":[]},{"id":"3ab83c4d2a526220","type":"debug","z":"eb90474bf03634f2","name":"debug 165","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":200,"wires":[]},{"id":"8b5cde76.edd58","type":"ui_group","name":"default","tab":"8f03e639.85956","order":1,"disp":false,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

If you read here , it explains how to get the paths from the debug node.
and watch these videos

Still not getting it...

Here's where I'm at

[
    {
        "id": "24bd94a6ca28cffd",
        "type": "ui_text",
        "z": "cb58b0f2ac83d096",
        "group": "3d153cb1a380b89c",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Brightness Level",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "",
        "x": 1050,
        "y": 220,
        "wires": []
    },
    {
        "id": "1adcbd7787bbc99e",
        "type": "ui_form",
        "z": "cb58b0f2ac83d096",
        "name": "",
        "label": "deskBrightness",
        "group": "61fa8ac8b4042d90",
        "order": 5,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "deskBrightness",
                "value": "deskBrightness",
                "type": "number",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "deskBrightness": ""
        },
        "payload": "",
        "submit": "submit",
        "cancel": "",
        "topic": "payload",
        "topicType": "msg",
        "splitLayout": "",
        "className": "",
        "x": 460,
        "y": 160,
        "wires": [
            [
                "28247b0271b0c372"
            ]
        ]
    },
    {
        "id": "a1daf67020415503",
        "type": "inject",
        "z": "cb58b0f2ac83d096",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "3",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "8",
        "payloadType": "num",
        "x": 290,
        "y": 160,
        "wires": [
            [
                "1adcbd7787bbc99e"
            ]
        ]
    },
    {
        "id": "3ab83c4d2a526220",
        "type": "debug",
        "z": "cb58b0f2ac83d096",
        "name": "debug 165",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1070,
        "y": 160,
        "wires": []
    },
    {
        "id": "28247b0271b0c372",
        "type": "json",
        "z": "cb58b0f2ac83d096",
        "name": "convert to object",
        "property": "payload.deskBrightness",
        "action": "obj",
        "pretty": false,
        "x": 660,
        "y": 160,
        "wires": [
            [
                "29061c4c2c261079"
            ]
        ]
    },
    {
        "id": "29061c4c2c261079",
        "type": "function",
        "z": "cb58b0f2ac83d096",
        "name": "object to payload",
        "func": "msg.payload = msg.payload.deskBrightness;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 870,
        "y": 160,
        "wires": [
            [
                "3ab83c4d2a526220",
                "24bd94a6ca28cffd"
            ]
        ]
    },
    {
        "id": "3d153cb1a380b89c",
        "type": "ui_group",
        "name": "LED Switch",
        "tab": "c548a45fe690539c",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "61fa8ac8b4042d90",
        "type": "ui_group",
        "name": "Barn Motion",
        "tab": "c548a45fe690539c",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "c548a45fe690539c",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": true
    }
]

Again here is all you need, I have removed unneeded nodes. You do not need to move the msg.payload.deskBrightness to msg.payload. Just use
{{msg.payload.deskBrightness}}

[{"id":"1adcbd7787bbc99e","type":"ui_form","z":"eb90474bf03634f2","name":"","label":"deskBrightness","group":"8b5cde76.edd58","order":5,"width":0,"height":0,"options":[{"label":"deskBrightness","value":"deskBrightness","type":"number","required":true,"rows":null}],"formValue":{"deskBrightness":""},"payload":"","submit":"submit","cancel":"","topic":"payload","topicType":"msg","splitLayout":"","className":"","x":300,"y":200,"wires":[["24bd94a6ca28cffd","3ab83c4d2a526220"]]},{"id":"24bd94a6ca28cffd","type":"ui_text","z":"eb90474bf03634f2","group":"8b5cde76.edd58","order":6,"width":0,"height":0,"name":"","label":"Brightness Level","format":"{{msg.payload.deskBrightness}}","layout":"row-spread","className":"","x":600,"y":260,"wires":[]},{"id":"3ab83c4d2a526220","type":"debug","z":"eb90474bf03634f2","name":"debug 165","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":200,"wires":[]},{"id":"8b5cde76.edd58","type":"ui_group","name":"default","tab":"8f03e639.85956","order":1,"disp":false,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

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