Capture data through a button to send to a dashboard

Hello everyone
I'm trying to load data in a "form" when the buttons are clicked.
Simulate sending data through a serial node using a random number generator.
Practically I needed that at the moment of selecting the left button, take the generated data and place it in the "Left Weight" box.
I would appreciate your help please
Thank you
Next I leave a screenshot of my flow and the code that I am doing.


[
    {
        "id": "b9860b4b9de8c8da",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "ccfc19e16e3b1ab3",
        "type": "debug",
        "z": "b9860b4b9de8c8da",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 720,
        "y": 240,
        "wires": []
    },
    {
        "id": "0a517f025b74c1bc",
        "type": "ui_form",
        "z": "b9860b4b9de8c8da",
        "name": "",
        "label": "",
        "group": "39608c8009062eb4",
        "order": 0,
        "width": 0,
        "height": 0,
        "options": [
            {
                "label": "Peso Izquierdo",
                "value": "pesoIz",
                "type": "number",
                "required": true,
                "rows": null
            },
            {
                "label": "Peso Derecho",
                "value": "pesoDer",
                "type": "number",
                "required": true,
                "rows": null
            },
            {
                "label": "Codigo",
                "value": "codigo",
                "type": "text",
                "required": false,
                "rows": null
            }
        ],
        "formValue": {
            "pesoIz": "",
            "pesoDer": "",
            "codigo": ""
        },
        "payload": "",
        "submit": "submit",
        "cancel": "cancel",
        "topic": "topic",
        "topicType": "msg",
        "splitLayout": "",
        "x": 590,
        "y": 240,
        "wires": [
            [
                "ccfc19e16e3b1ab3"
            ]
        ]
    },
    {
        "id": "6c563470a0aa3605",
        "type": "ui_button",
        "z": "b9860b4b9de8c8da",
        "name": "",
        "group": "61241346eee7b574",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Izquierdo",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "refresh",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 620,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "577ba779ab59b544",
        "type": "Number",
        "z": "b9860b4b9de8c8da",
        "name": "serial",
        "minimum": "0",
        "maximum": "10",
        "roundTo": "1",
        "Floor": false,
        "x": 190,
        "y": 180,
        "wires": [
            [
                "c5783a55c2383752"
            ]
        ]
    },
    {
        "id": "334010747171ec43",
        "type": "Number",
        "z": "b9860b4b9de8c8da",
        "name": "serial",
        "minimum": "0",
        "maximum": "10",
        "roundTo": "1",
        "Floor": false,
        "x": 190,
        "y": 320,
        "wires": [
            [
                "04738d0d48c4daea"
            ]
        ]
    },
    {
        "id": "c5783a55c2383752",
        "type": "change",
        "z": "b9860b4b9de8c8da",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "msg",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            },
            {
                "t": "delete",
                "p": "payload",
                "pt": "msg"
            },
            {
                "t": "set",
                "p": "payload.pesoIz",
                "pt": "msg",
                "to": "msg",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 440,
        "y": 180,
        "wires": [
            [
                "0a517f025b74c1bc"
            ]
        ]
    },
    {
        "id": "04738d0d48c4daea",
        "type": "change",
        "z": "b9860b4b9de8c8da",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "msg",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            },
            {
                "t": "delete",
                "p": "payload",
                "pt": "msg"
            },
            {
                "t": "set",
                "p": "payload.pesoDer",
                "pt": "msg",
                "to": "msg",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 440,
        "y": 320,
        "wires": [
            [
                "0a517f025b74c1bc"
            ]
        ]
    },
    {
        "id": "786cc52009ec82da",
        "type": "ui_button",
        "z": "b9860b4b9de8c8da",
        "name": "",
        "group": "61241346eee7b574",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Derecho",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "refresh",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 600,
        "y": 380,
        "wires": [
            []
        ]
    },
    {
        "id": "062f1d54dd044b4b",
        "type": "inject",
        "z": "b9860b4b9de8c8da",
        "name": "SERIAL",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 60,
        "y": 240,
        "wires": [
            [
                "577ba779ab59b544",
                "334010747171ec43"
            ]
        ]
    },
    {
        "id": "39608c8009062eb4",
        "type": "ui_group",
        "name": "Default",
        "tab": "39e436e1db47faa2",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "61241346eee7b574",
        "type": "ui_group",
        "name": "Actualizar",
        "tab": "39e436e1db47faa2",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "39e436e1db47faa2",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Not sure i fully understand what you describe.
This may help, if i understand correctly.

[{"id":"6c563470a0aa3605","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Izquierdo","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"{}","payloadType":"json","topic":"topic","topicType":"msg","x":460,"y":140,"wires":[["5ab8ba3803cdc796"]]},{"id":"6b3c9667c11305cb","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"move","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"},{"t":"set","p":"topic[1]","pt":"msg","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":220,"wires":[["6c563470a0aa3605","786cc52009ec82da","79bfdf52980ba27e"]]},{"id":"5ab8ba3803cdc796","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"move","p":"topic[1]","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":140,"wires":[["653793b2593cc5f0"]]},{"id":"0a517f025b74c1bc","type":"ui_form","z":"b9860b4b9de8c8da","name":"","label":"","group":"39608c8009062eb4","order":0,"width":0,"height":0,"options":[{"label":"Peso Izquierdo","value":"pesoIz","type":"number","required":true,"rows":null},{"label":"Peso Derecho","value":"pesoDer","type":"number","required":true,"rows":null},{"label":"Codigo","value":"codigo","type":"text","required":false,"rows":null}],"formValue":{"pesoIz":"","pesoDer":"","codigo":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","x":410,"y":220,"wires":[["6b3c9667c11305cb"]]},{"id":"786cc52009ec82da","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Derecho","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"{}","payloadType":"json","topic":"topic","topicType":"msg","x":460,"y":300,"wires":[["8203b0ae864947a4"]]},{"id":"79bfdf52980ba27e","type":"ui_text","z":"b9860b4b9de8c8da","group":"61241346eee7b574","order":2,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","x":750,"y":220,"wires":[]},{"id":"653793b2593cc5f0","type":"debug","z":"b9860b4b9de8c8da","name":"debug 264","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":80,"wires":[]},{"id":"c5783a55c2383752","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"test","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{\t    \"pesoIz\":$round($random()*10,1),\t    \"pesoDer\":$round($random()*10,1)\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":220,"wires":[["0a517f025b74c1bc"]]},{"id":"8203b0ae864947a4","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"move","p":"topic[1]","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":300,"wires":[["794b4e0745d869d4"]]},{"id":"062f1d54dd044b4b","type":"inject","z":"b9860b4b9de8c8da","name":"SERIAL","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":110,"y":220,"wires":[["c5783a55c2383752"]]},{"id":"794b4e0745d869d4","type":"debug","z":"b9860b4b9de8c8da","name":"debug 265","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":380,"wires":[]},{"id":"61241346eee7b574","type":"ui_group","name":"Actualizar","tab":"39e436e1db47faa2","order":2,"disp":true,"width":"6","collapse":false},{"id":"39608c8009062eb4","type":"ui_group","name":"Default","tab":"39e436e1db47faa2","order":1,"disp":true,"width":"6","collapse":false},{"id":"39e436e1db47faa2","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

In my code the "Peso Izquierdo" and "Peso Derecho" fields are entered automatically, but I need them to be entered only when I click the "Izquierdo" and "Derecho" button of the "Actualizar" group.

Again not fully understanding, if this is not going in right direction i will need a fully explanation, maybe with diagrams.

[{"id":"062f1d54dd044b4b","type":"inject","z":"b9860b4b9de8c8da","name":"SERIAL","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":90,"y":180,"wires":[["6c563470a0aa3605","786cc52009ec82da"]]},{"id":"6c563470a0aa3605","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Izquierdo","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"{}","payloadType":"str","topic":"pesoIz","topicType":"str","x":220,"y":140,"wires":[["c5783a55c2383752"]]},{"id":"786cc52009ec82da","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Derecho","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"","payloadType":"str","topic":"pesoDer","topicType":"str","x":220,"y":220,"wires":[["c5783a55c2383752"]]},{"id":"c5783a55c2383752","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$round($random()*10,1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":180,"wires":[["34164d115e993a3e"]]},{"id":"34164d115e993a3e","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610,"y":180,"wires":[["0a517f025b74c1bc","653793b2593cc5f0"]]},{"id":"0a517f025b74c1bc","type":"ui_form","z":"b9860b4b9de8c8da","name":"","label":"","group":"39608c8009062eb4","order":0,"width":0,"height":0,"options":[{"label":"Peso Izquierdo","value":"pesoIz","type":"number","required":true,"rows":null},{"label":"Peso Derecho","value":"pesoDer","type":"number","required":true,"rows":null},{"label":"Codigo","value":"codigo","type":"text","required":false,"rows":null}],"formValue":{"pesoIz":"","pesoDer":"","codigo":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":610,"y":260,"wires":[["79bfdf52980ba27e"]]},{"id":"653793b2593cc5f0","type":"debug","z":"b9860b4b9de8c8da","name":"debug 264","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":80,"wires":[]},{"id":"79bfdf52980ba27e","type":"ui_text","z":"b9860b4b9de8c8da","group":"61241346eee7b574","order":2,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","x":750,"y":220,"wires":[]},{"id":"61241346eee7b574","type":"ui_group","name":"Actualizar","tab":"39e436e1db47faa2","order":2,"disp":true,"width":"6","collapse":false},{"id":"39608c8009062eb4","type":"ui_group","name":"Default","tab":"39e436e1db47faa2","order":1,"disp":true,"width":"6","collapse":false},{"id":"39e436e1db47faa2","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Ok, but I want the "set msg.payload" node to be before the button nodes.

As shown in the picture

Then blend the 2 examples to pass the payload through the button nodes.
e.g.

[{"id":"062f1d54dd044b4b","type":"inject","z":"b9860b4b9de8c8da","name":"SERIAL","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":90,"y":180,"wires":[["c5783a55c2383752","1a2aad53e302635d"]]},{"id":"c5783a55c2383752","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"topic[1]","pt":"msg","to":"$round($random()*10,1)","tot":"jsonata"},{"t":"set","p":"topic[0]","pt":"msg","to":"pesoIz","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":140,"wires":[["6c563470a0aa3605"]]},{"id":"1a2aad53e302635d","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"topic[1]","pt":"msg","to":"$round($random()*10,1)","tot":"jsonata"},{"t":"set","p":"topic[0]","pt":"msg","to":"pesoDer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":220,"wires":[["786cc52009ec82da"]]},{"id":"6c563470a0aa3605","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Izquierdo","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"{}","payloadType":"str","topic":"topic","topicType":"msg","x":400,"y":140,"wires":[["da3a1e5bac5e4bab"]]},{"id":"786cc52009ec82da","type":"ui_button","z":"b9860b4b9de8c8da","name":"","group":"61241346eee7b574","order":1,"width":0,"height":0,"passthru":false,"label":"Derecho","tooltip":"","color":"","bgcolor":"","className":"","icon":"refresh","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":400,"y":220,"wires":[["da3a1e5bac5e4bab"]]},{"id":"da3a1e5bac5e4bab","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"topic[1]","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":180,"wires":[["34164d115e993a3e"]]},{"id":"34164d115e993a3e","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610,"y":180,"wires":[["0a517f025b74c1bc","653793b2593cc5f0"]]},{"id":"0a517f025b74c1bc","type":"ui_form","z":"b9860b4b9de8c8da","name":"","label":"","group":"39608c8009062eb4","order":0,"width":0,"height":0,"options":[{"label":"Peso Izquierdo","value":"pesoIz","type":"number","required":true,"rows":null},{"label":"Peso Derecho","value":"pesoDer","type":"number","required":true,"rows":null},{"label":"Codigo","value":"codigo","type":"multiline","required":false,"rows":3}],"formValue":{"pesoIz":"","pesoDer":"","codigo":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":610,"y":260,"wires":[["79bfdf52980ba27e"]]},{"id":"653793b2593cc5f0","type":"debug","z":"b9860b4b9de8c8da","name":"debug 264","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":80,"wires":[]},{"id":"79bfdf52980ba27e","type":"ui_text","z":"b9860b4b9de8c8da","group":"61241346eee7b574","order":2,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","x":750,"y":220,"wires":[]},{"id":"61241346eee7b574","type":"ui_group","name":"Actualizar","tab":"39e436e1db47faa2","order":2,"disp":true,"width":"6","collapse":false},{"id":"39608c8009062eb4","type":"ui_group","name":"Default","tab":"39e436e1db47faa2","order":1,"disp":true,"width":"6","collapse":false},{"id":"39e436e1db47faa2","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Sorry to keep bothering you, I need to do the same process as the previous answer.
In the code I want the load sent by the node inject to pass only when the button node allows it.

Beforehand thank you very much

[{"id":"70632bcb2cd1f7fd","type":"tab","label":"vacas","disabled":false,"info":""},{"id":"be7294e0cb904cbe","type":"ui_form","z":"70632bcb2cd1f7fd","name":"","label":"","group":"53ea05b1f77123f0","order":1,"width":6,"height":2,"options":[{"label":"Canal Izquierdo","value":"pesoIzq","type":"number","required":true,"rows":null},{"label":"Canal Derecho","value":"pesoDer","type":"number","required":true,"rows":null},{"label":"Peso Total","value":"pesoTotal","type":"number","required":true,"rows":null},{"label":"Tipo","value":"tipo","type":"text","required":true,"rows":null},{"label":"Código","value":"codigo","type":"number","required":true,"rows":null}],"formValue":{"pesoIzq":"","pesoDer":"","pesoTotal":"","tipo":"","codigo":""},"payload":"","submit":"Enviar","cancel":"Cancelar","topic":"topic","topicType":"msg","splitLayout":false,"x":830,"y":240,"wires":[["78f026c7859cec06"]]},{"id":"e065c802a95e8b14","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"msg","pt":"flow","to":"msg.payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.tipo","pt":"msg","to":"msg","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":440,"wires":[["be7294e0cb904cbe"]]},{"id":"c833e75e7a827ae9","type":"inject","z":"70632bcb2cd1f7fd","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"bovino","payloadType":"str","x":500,"y":440,"wires":[["e065c802a95e8b14"]]},{"id":"0e4c6fc2d5c0a24d","type":"debug","z":"70632bcb2cd1f7fd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1110,"y":240,"wires":[]},{"id":"949fb946746d9f03","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"msg","pt":"flow","to":"msg.payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.pesoDer","pt":"msg","to":"msg","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":380,"wires":[["9bb76d1abe4b763b"]]},{"id":"28e1a84806c261fd","type":"SumUltimate","z":"70632bcb2cd1f7fd","name":"peso","property":"payload","math":"sum","x":490,"y":240,"wires":[["f0539ccd2ea285d1"]]},{"id":"a1fa6331b061ae96","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":160,"wires":[["28e1a84806c261fd"]]},{"id":"dea8c680821e1709","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"b","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[["28e1a84806c261fd"]]},{"id":"f0539ccd2ea285d1","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"msg","pt":"flow","to":"msg.payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.pesoTotal","pt":"msg","to":"msg","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":240,"wires":[["be7294e0cb904cbe"]]},{"id":"78f026c7859cec06","type":"function","z":"70632bcb2cd1f7fd","name":"","func":"let codigo =msg.payload.codigo;\nlet txt=codigo.toString();\ntxt = txt.slice(0, 3) + \"-\" + txt.slice(3);\nmsg.payload.codigo=txt\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":240,"wires":[["0e4c6fc2d5c0a24d"]]},{"id":"dfe6dad6cb8e09ed","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"msg","pt":"flow","to":"msg.payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.pesoIzq","pt":"msg","to":"msg","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":80,"wires":[["113e1eb8706cc58f"]]},{"id":"b922e83576728771","type":"function","z":"70632bcb2cd1f7fd","name":"","func":"let izq=msg.payload;\nizq=izq.slice(14,16);\nmsg.payload=izq;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":120,"wires":[["dfe6dad6cb8e09ed","a1fa6331b061ae96"]]},{"id":"72b38bf4996c13f7","type":"inject","z":"70632bcb2cd1f7fd","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"ST,NT,5       10 kg","payloadType":"str","x":80,"y":120,"wires":[[]]},{"id":"05dfeb169b2e5bc3","type":"ui_button","z":"70632bcb2cd1f7fd","name":"","group":"53ea05b1f77123f0","order":2,"width":2,"height":1,"passthru":false,"label":"Izq","tooltip":"","color":"black","bgcolor":"","icon":"refresh","payload":"","payloadType":"str","topic":"payload","topicType":"msg","x":210,"y":60,"wires":[[]]},{"id":"9bb76d1abe4b763b","type":"function","z":"70632bcb2cd1f7fd","name":"","func":"let str =msg.payload.pesoDer;\nlet txt1=parseFloat(str);\n\nmsg.payload.pesoDer=txt1\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":380,"wires":[["be7294e0cb904cbe"]]},{"id":"113e1eb8706cc58f","type":"function","z":"70632bcb2cd1f7fd","name":"","func":"let str2 =msg.payload.pesoIzq;\nlet txt2=parseFloat(str2);\n\nmsg.payload.pesoIzq=txt2\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":80,"wires":[["be7294e0cb904cbe"]]},{"id":"fe4936bb5e237e3c","type":"inject","z":"70632bcb2cd1f7fd","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"ST,NT,5       20 kg","payloadType":"str","x":80,"y":380,"wires":[[]]},{"id":"7c35448335f7986c","type":"function","z":"70632bcb2cd1f7fd","name":"","func":"let der=msg.payload;\nder=der.slice(14,16);\nmsg.payload=der;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":380,"wires":[["dea8c680821e1709","949fb946746d9f03"]]},{"id":"448ef27ef8a278a8","type":"ui_button","z":"70632bcb2cd1f7fd","name":"","group":"53ea05b1f77123f0","order":3,"width":2,"height":1,"passthru":false,"label":"Der","tooltip":"","color":"black","bgcolor":"","icon":"refresh","payload":"","payloadType":"num","topic":"topic","topicType":"msg","x":210,"y":320,"wires":[[]]},{"id":"53ea05b1f77123f0","type":"ui_group","name":"                Registro de información","tab":"aa7efaac062e3431","order":1,"disp":true,"width":"8","collapse":false},{"id":"aa7efaac062e3431","type":"ui_tab","name":"Ganado Bovino","icon":"input","order":2,"disabled":false,"hidden":false}]

I already showed you how to pass a payload through a button node, you will have to apply it to your flow.

Here is another example of how to pass a payload through a button node, using a join and a switch node. I include the first example to.

[{"id":"72b38bf4996c13f7","type":"inject","z":"70632bcb2cd1f7fd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Ixq","payload":"ST,NT,5       10 kg","payloadType":"str","x":190,"y":120,"wires":[["4480466c261c9d0e"]]},{"id":"4480466c261c9d0e","type":"join","z":"70632bcb2cd1f7fd","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":290,"y":200,"wires":[["eb821125d4876cee"]]},{"id":"05dfeb169b2e5bc3","type":"ui_button","z":"70632bcb2cd1f7fd","name":"","group":"53ea05b1f77123f0","order":2,"width":2,"height":1,"passthru":false,"label":"Izq","tooltip":"","color":"black","bgcolor":"","className":"","icon":"refresh","payload":"","payloadType":"str","topic":"button","topicType":"str","x":150,"y":200,"wires":[["4480466c261c9d0e"]]},{"id":"eb821125d4876cee","type":"switch","z":"70632bcb2cd1f7fd","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"button","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":200,"wires":[["66722fb7b3d015ad"]]},{"id":"66722fb7b3d015ad","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Ixq","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":200,"wires":[["bc5414e042e6a336"]]},{"id":"bc5414e042e6a336","type":"debug","z":"70632bcb2cd1f7fd","name":"debug 265","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":120,"wires":[]},{"id":"728b508035c135a9","type":"inject","z":"70632bcb2cd1f7fd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Ixq","payload":"ST,NT,5       10 kg","payloadType":"str","x":110,"y":300,"wires":[["6d34e639bedbf827"]]},{"id":"6d34e639bedbf827","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"move","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"},{"t":"set","p":"topic[1]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":300,"wires":[["093b30fe6bb8769f"]]},{"id":"093b30fe6bb8769f","type":"ui_button","z":"70632bcb2cd1f7fd","name":"","group":"53ea05b1f77123f0","order":2,"width":2,"height":1,"passthru":false,"label":"Izq","tooltip":"","color":"black","bgcolor":"","className":"","icon":"refresh","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":450,"y":300,"wires":[["dc57946057bed93f"]]},{"id":"dc57946057bed93f","type":"change","z":"70632bcb2cd1f7fd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"topic[1]","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"topic[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":300,"wires":[["1eabc8c759fb55ac"]]},{"id":"1eabc8c759fb55ac","type":"debug","z":"70632bcb2cd1f7fd","name":"debug 266","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":300,"wires":[]},{"id":"53ea05b1f77123f0","type":"ui_group","name":"                Registro de información","tab":"aa7efaac062e3431","order":1,"disp":true,"width":"8","collapse":false},{"id":"aa7efaac062e3431","type":"ui_tab","name":"Ganado Bovino","icon":"input","order":2,"disabled":false,"hidden":false}]

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