Array to object function

Hi, I hope someone could help me with this I have this code so is kind of database of equations, and when I save a new one it appears on the dropdown, so my problem is that it appears as number in the dropdown but I need the equation. This is my code.

[{"id":"f9a6103a.341d","type":"tab","label":"ecuacion basse de datos","disabled":false,"info":""},{"id":"aab5d463.2d90b8","type":"inject","z":"f9a6103a.341d","name":"Daily backup","repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":160,"y":340,"wires":[["c52505d7.842528"]]},{"id":"c52505d7.842528","type":"function","z":"f9a6103a.341d","name":"Prep data","func":"// global variables separated by semicolon to be saved\nvar globallist = \"equa\"\nvar mylist = globallist.split(\";\");\n\nvar outputs = [];\n\nfor (i=0; i<mylist.length; i++) {\n    outputs.push({ key : mylist[i], type: typeof global.get(mylist[i]), value: global.get(mylist[i])});\n}\n      \n      \nmsg.payload = outputs;\nreturn msg;\n\n","outputs":1,"noerr":0,"x":340,"y":340,"wires":[["46f289db.f51008"]]},{"id":"a9cc538d.0f9f3","type":"comment","z":"f9a6103a.341d","name":"Save global variables","info":"","x":160,"y":300,"wires":[]},{"id":"9c6f3be1.704888","type":"comment","z":"f9a6103a.341d","name":"Restore global variables","info":"","x":160,"y":380,"wires":[]},{"id":"b6c51d07.161a1","type":"inject","z":"f9a6103a.341d","name":"Startup","repeat":"","crontab":"","once":true,"topic":"","payload":"","payloadType":"date","x":140,"y":420,"wires":[["88f5dbb5.cfe298"]]},{"id":"e49c839c.88c38","type":"file","z":"f9a6103a.341d","name":"","filename":"/home/pi/global.json","appendNewline":true,"createDir":false,"overwriteFile":"false","x":800,"y":320,"wires":[["885c684d.01bb08"]]},{"id":"88f5dbb5.cfe298","type":"file in","z":"f9a6103a.341d","name":"","filename":"/home/pi/global.json","format":"utf8","x":340,"y":420,"wires":[["e8ebbd1b.17163"]]},{"id":"46f289db.f51008","type":"json","z":"f9a6103a.341d","name":"","property":"payload","action":"","pretty":false,"x":490,"y":340,"wires":[["e49c839c.88c38"]]},{"id":"e8ebbd1b.17163","type":"json","z":"f9a6103a.341d","name":"","property":"payload","action":"str","pretty":false,"x":510,"y":420,"wires":[["92ac1160.6639d"]]},{"id":"885c684d.01bb08","type":"debug","z":"f9a6103a.341d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":320,"wires":[]},{"id":"1e7a28fe.7d2177","type":"ui_text_input","z":"f9a6103a.341d","name":"","label":"","tooltip":"","group":"3dc69e5a.3a0552","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":160,"y":60,"wires":[["fe05ec6d.d42a2"]]},{"id":"4e84e1b1.f74f4","type":"ui_dropdown","z":"f9a6103a.341d","name":"","label":"","tooltip":"","place":"Select option","group":"bd526cf2.a7aee","order":0,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":1080,"y":420,"wires":[["398c12d3.ac5bce","a4b08593.f4ca88"]]},{"id":"398c12d3.ac5bce","type":"ui_toast","z":"f9a6103a.341d","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":1390,"y":480,"wires":[]},{"id":"366099ce.8fb416","type":"inject","z":"f9a6103a.341d","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"y = 2.1425x + 3.8416","payloadType":"str","x":180,"y":160,"wires":[["5a40815d.e1843"]]},{"id":"5b217509.41b30c","type":"inject","z":"f9a6103a.341d","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"y = 4.4607x + 8.3455","payloadType":"str","x":180,"y":200,"wires":[["5a40815d.e1843"]]},{"id":"66710816.fb33b8","type":"inject","z":"f9a6103a.341d","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"y = 7.5648x + 13.75","payloadType":"str","x":170,"y":240,"wires":[["5a40815d.e1843"]]},{"id":"5a40815d.e1843","type":"function","z":"f9a6103a.341d","name":"","func":"if (!context.outputAlarms) {\n   context.outputAlarms = [];\n}\ncontext.outputAlarms.push(msg.payload);\nmsg.payload = context.outputAlarms;\nreturn msg; ","outputs":1,"noerr":0,"x":430,"y":200,"wires":[["7d3559c2.a65af8"]]},{"id":"fe05ec6d.d42a2","type":"function","z":"f9a6103a.341d","name":"","func":"if (!context.outputAlarms) {\n   context.outputAlarms = [];\n}\ncontext.outputAlarms.push(msg.payload);\nmsg.payload = context.outputAlarms;\nreturn msg; ","outputs":1,"noerr":0,"x":390,"y":60,"wires":[["6221338d.65f80c"]]},{"id":"6221338d.65f80c","type":"debug","z":"f9a6103a.341d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":60,"wires":[]},{"id":"7d3559c2.a65af8","type":"function","z":"f9a6103a.341d","name":"","func":"var equa = msg.payload;\n\nglobal.set('equa',equa);\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":200,"wires":[["58193c8e.c29964"]]},{"id":"58193c8e.c29964","type":"debug","z":"f9a6103a.341d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":200,"wires":[]},{"id":"35653221.5d269e","type":"comment","z":"f9a6103a.341d","name":"equation data in","info":"","x":140,"y":120,"wires":[]},{"id":"a4b08593.f4ca88","type":"function","z":"f9a6103a.341d","name":"dropdown case","func":"let a = msg.payload;\nvar n = 2;\nvar m = 3;\nswitch (a){\n    case \"y = 4.4607x + 8.3455 \" :\n       msg.payload = n+m;\n\t\treturn msg;\n\t\n\tcase \"y = 2.1425x + 3.8416 \":\n\t    msg.payload = m-n;\n\t\treturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1380,"y":240,"wires":[["5aec4b97.187d74"]]},{"id":"5aec4b97.187d74","type":"debug","z":"f9a6103a.341d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1570,"y":240,"wires":[]},{"id":"8d7c5286.0f60a","type":"change","z":"f9a6103a.341d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"equa\":\"\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":480,"wires":[["e6ffd047.e5d62"]]},{"id":"e6ffd047.e5d62","type":"debug","z":"f9a6103a.341d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":500,"wires":[]},{"id":"92ac1160.6639d","type":"function","z":"f9a6103a.341d","name":"","func":"var arr = global.get(\"equa\")||[];\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":420,"wires":[["8d7c5286.0f60a","e90fe93c.2533b8"]]},{"id":"e90fe93c.2533b8","type":"function","z":"f9a6103a.341d","name":"transform data to correct format","func":"msg.options = [];//create empty array\n    let row = msg.payload; //get the row\n    msg.options.push(row);//add the row to array    \nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":870,"y":420,"wires":[["4e84e1b1.f74f4"]]},{"id":"3dc69e5a.3a0552","type":"ui_group","z":"","name":"Default","tab":"415fe984.5556a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"bd526cf2.a7aee","type":"ui_group","z":"","name":"Default","tab":"cd7f0463.187ef8","order":1,"disp":true,"width":"6","collapse":false},{"id":"415fe984.5556a8","type":"ui_tab","z":"","name":"dropdown","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"cd7f0463.187ef8","type":"ui_tab","z":"","name":"Menu","icon":"fa-tachometer","order":1,"disabled":false,"hidden":false}]

so in the pointed node I'm trying to chance the array to an object. Help please.

Not sure what your data is
in the previous function node you could do

msg.payload = Object.assign({}, arr);

what I want is something like this 2 dropdown

[{"id":"4526cd47.623524","type":"inject","z":"4ee0e132.e7df2","name":"Fake DB Result","topic":"","payload":"[[\"bob\",1],[\"rita\",2],[\"sue\",3]]","payloadType":"json","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":160,"y":320,"wires":[["e2acd642.38aa98"]]},{"id":"e2acd642.38aa98","type":"function","z":"4ee0e132.e7df2","name":"transform data to correct format","func":"//as per info panel, the data needs to be formatted\n//as [ \"Choice 1\", \"Choice 2\", {\"Choice 3\":\"3\"} ]\n//and sent in msg.options.\nmsg.options = [];//create empty array\nfor(let i = 0; i < msg.payload.length; i++){\n    let row = msg.payload[i]; //get the row\n    let opt = {};//make new opt object\n    opt[row[0]] = row[1]; //add a propery to object called row[0] & set its value to row[1]\n    msg.options.push(opt);//add the opt to array    \n}\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":320,"wires":[["45e76152.32dcd"]]},{"id":"45e76152.32dcd","type":"ui_dropdown","z":"4ee0e132.e7df2","name":"","label":"","tooltip":"","place":"Select option","group":"1a45cdd4.2db222","order":0,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":620,"y":320,"wires":[["ed546608.89a868"]]},{"id":"ed546608.89a868","type":"ui_toast","z":"4ee0e132.e7df2","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":320,"y":360,"wires":[]},{"id":"1a45cdd4.2db222","type":"ui_group","z":"","name":"Default","tab":"35ff53eb.0e3c8c","disp":true,"width":"6","collapse":false},{"id":"35ff53eb.0e3c8c","type":"ui_tab","z":"","name":"Menu","icon":"fa-tachometer","order":1,"disabled":false,"hidden":false}]

So you have the function to convert, i don't see what else you need.

Or are you looking for a JSONata expression to do your function in the change node?

edit/
I see you want bob to show in notification , is that correct

You can feed it an array no need for the object. Then the label and value would be the same

from info " msg.options containing an array. If just text then the value will be the same as the label, otherwise you can specify both by using an object of "label":"value" pairs :

[ "Choice 1", "Choice 2","

[{"id":"163ddde2.2ebeda","type":"function","z":"5e968879.8bee88","name":"transform data to correct format","func":"//as per info panel, the data needs to be formatted\n//as [ \"Choice 1\", \"Choice 2\", {\"Choice 3\":\"3\"} ]\n//and sent in msg.options.\nmsg.options = [];//create empty array\nfor(let i = 0; i < msg.payload.length; i++){\n    msg.options.push(msg.payload[i][0]);//add the opt to array    \n}\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":120,"wires":[["8e1478f2.d4b1b"]]}]

Hi, thanks I already solve thanks for your help now I have a new problem I will put my flow.

[{"id":"6c7cd6d1.bf7668","type":"inject","z":"bd64dc92.8bd4b","name":"Daily backup","repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":200,"y":700,"wires":[["167f859.469237a"]]},{"id":"167f859.469237a","type":"function","z":"bd64dc92.8bd4b","name":"Prep data","func":"// global variables separated by semicolon to be saved\nvar globallist = \"equa\"\nvar mylist = globallist.split(\";\");\n\nvar outputs = [];\n\nfor (i=0; i<mylist.length; i++) {\n    outputs.push({ key : mylist[i], type: typeof global.get(mylist[i]), value: global.get(mylist[i])});\n}\n      \n      \nmsg.payload = outputs;\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":700,"wires":[["c092688d.4ff978"]]},{"id":"2269a29f.c30b8e","type":"comment","z":"bd64dc92.8bd4b","name":"Save global variables","info":"","x":200,"y":660,"wires":[]},{"id":"4f3caad9.168674","type":"comment","z":"bd64dc92.8bd4b","name":"Restore global variables","info":"","x":200,"y":740,"wires":[]},{"id":"c0b54f5c.002df","type":"inject","z":"bd64dc92.8bd4b","name":"Startup","repeat":"","crontab":"","once":true,"topic":"","payload":"","payloadType":"date","x":180,"y":780,"wires":[["611af823.f677e8"]]},{"id":"b004467f.6bc3c8","type":"file","z":"bd64dc92.8bd4b","name":"","filename":"/home/pi//Desktop/datosecuaciones/ecuabasecali.json","appendNewline":true,"createDir":false,"overwriteFile":"false","x":760,"y":640,"wires":[["435d2e0f.ccb1e"]]},{"id":"611af823.f677e8","type":"file in","z":"bd64dc92.8bd4b","name":"","filename":"/home/pi//Desktop/datosecuaciones/ecuabasecali.json","format":"utf8","x":380,"y":960,"wires":[["84476348.26d55"]]},{"id":"e700966c.5580a8","type":"function","z":"bd64dc92.8bd4b","name":"Restore","func":"var output = [];\n\nfor (var i=0; i<msg.payload.length; i++) {\n    switch (msg.payload[i].type) {\n        case 'undefined': \n            // the global variable probably had no value, nothing needs to be restored\n            output.push(msg.payload[i].key + \" is undefined.\");\n            break;\n        case 'number':\n            if (msg.payload[i].value===\"NaN\") {\n                // there is no valid value to be restored, skip this variable\n                output.push(msg.payload[i].key + \" is NaN.\");\n            } else {\n                if (msg.payload[i].value.toString().indexOf(\".\")>-1) {\n                    // the value appears to be a float\n                    global.set(msg.payload[i].key,parseFloat(msg.payload[i].value));\n                    output.push(msg.payload[i].key + \" is restored to \" + msg.payload[i].value);\n                } else {\n                    global.set(msg.payload[i].key,parseInt(msg.payload[i].value));\n                    output.push(msg.payload[i].key + \" is restored to \" + msg.payload[i].value);\n                }\n            }\n            break;\n        case 'string':\n            global.set(msg.payload[i].key,msg.payload[i].value);\n            output.push(msg.payload[i].key + \" is restored to \" + msg.payload[i].value);\n            break;\n        case 'boolean':\n            global.set(msg.payload[i].key,msg.payload[i].value===\"true\");\n            output.push(msg.payload[i].key + \" is restored to \" + msg.payload[i].value);\n            break;\n    }\n}\n\nmsg.payload = output;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":1000,"wires":[["4a80ea90.e97b54"]]},{"id":"c092688d.4ff978","type":"json","z":"bd64dc92.8bd4b","name":"","property":"payload","action":"","pretty":false,"x":530,"y":700,"wires":[["b004467f.6bc3c8"]]},{"id":"84476348.26d55","type":"json","z":"bd64dc92.8bd4b","name":"","property":"payload","action":"str","pretty":false,"x":550,"y":780,"wires":[["e700966c.5580a8"]]},{"id":"435d2e0f.ccb1e","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1070,"y":680,"wires":[]},{"id":"acd379c.a365588","type":"ui_text_input","z":"bd64dc92.8bd4b","name":"","label":"","tooltip":"","group":"13bef394.605cfc","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":180,"y":420,"wires":[["c4e70995.1daf08"]]},{"id":"3d2512ea.2d3a4e","type":"ui_dropdown","z":"bd64dc92.8bd4b","name":"","label":"","tooltip":"","place":"Select option","group":"939a9aa1.29dc68","order":0,"width":0,"height":0,"passthru":true,"multiple":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":1240,"y":780,"wires":[["132c484a.75c138","561445ac.25610c"]]},{"id":"132c484a.75c138","type":"ui_toast","z":"bd64dc92.8bd4b","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":1430,"y":840,"wires":[]},{"id":"d089f5fd.30e6b8","type":"function","z":"bd64dc92.8bd4b","name":"transform data to correct format","func":"msg.options = [];//create empty array\n    let row = msg.payload; //get the row\n    msg.options.push(row);//add the row to array    \nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":990,"y":820,"wires":[["fc631363.368cf"]]},{"id":"b32478e1.5024e8","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2.1425x + 3.8416","payloadType":"str","x":200,"y":520,"wires":[["c4e70995.1daf08"]]},{"id":"2b79d692.7d5b0a","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4.4607x + 8.3455","payloadType":"str","x":180,"y":560,"wires":[["c4e70995.1daf08"]]},{"id":"29e0c364.50619c","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"7.5648x + 13.75","payloadType":"str","x":220,"y":600,"wires":[["c4e70995.1daf08"]]},{"id":"4a80ea90.e97b54","type":"function","z":"bd64dc92.8bd4b","name":"","func":"var arr = global.get(\"equa\")||[];\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"x":810,"y":780,"wires":[["d089f5fd.30e6b8"]]},{"id":"57d28e6a.0d59e","type":"function","z":"bd64dc92.8bd4b","name":"","func":"if (!context.outputAlarms) {\n   context.outputAlarms = [];\n}\ncontext.outputAlarms.push(msg.payload);\nmsg.payload = context.outputAlarms;\nreturn msg; ","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":500,"wires":[["5100a8c8.737e88"]]},{"id":"574ecccb.08e414","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":500,"wires":[]},{"id":"5100a8c8.737e88","type":"function","z":"bd64dc92.8bd4b","name":"","func":"var equa = msg.payload;\n\nglobal.set('equa',equa);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":500,"wires":[["574ecccb.08e414"]]},{"id":"3a1325a6.18b1aa","type":"comment","z":"bd64dc92.8bd4b","name":"equation data in","info":"","x":180,"y":480,"wires":[]},{"id":"561445ac.25610c","type":"function","z":"bd64dc92.8bd4b","name":"dropdown case","func":"let a = msg.payload;\nvar n = 2;\nvar m = 3;\nswitch (a){\n    case \"y = 4.4607x + 8.3455 \" :\n       msg.payload = n+m;\n\t\treturn msg;\n\t\n\tcase \"y = 2.1425x + 3.8416 \":\n\t    msg.payload = m-n;\n\t\treturn msg;\n}","outputs":1,"noerr":0,"x":1420,"y":600,"wires":[["58820069.b22ae"]]},{"id":"58820069.b22ae","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1610,"y":600,"wires":[]},{"id":"c4e70995.1daf08","type":"function","z":"bd64dc92.8bd4b","name":"","func":"var ecuabase = msg.payload;\nvar item = msg.topic;\n\nvar objeto = {\n  equation: ecuabase,\n  variables: item\n};\nmsg.payload = objeto;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":520,"wires":[["57d28e6a.0d59e"]]},{"id":"fc631363.368cf","type":"function","z":"bd64dc92.8bd4b","name":"transform data","func":"//as per info panel, the data needs to be formatted\n//as [ \"Choice 1\", \"Choice 2\", {\"Choice 3\":\"3\"} ]\n//and sent in msg.options.\nmsg.options = [];//create empty array\nfor(let i = 0; i < msg.payload.length; i++){\n    let row = msg.payload[i]; //get the row\n    let opt = {};//make new opt object\n    opt[row.equation] = row.equation; \n    msg.options.push(opt);//add the opt to array    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":740,"wires":[["3d2512ea.2d3a4e"]]},{"id":"13bef394.605cfc","type":"ui_group","z":"","name":"ingreseecuacionesacalibrar","tab":"22ba44f8.aa5d7c","order":2,"disp":true,"width":"6","collapse":false},{"id":"939a9aa1.29dc68","type":"ui_group","z":"","name":"ecuaciiones guardadas","tab":"22ba44f8.aa5d7c","order":3,"disp":true,"width":"6","collapse":false},{"id":"22ba44f8.aa5d7c","type":"ui_tab","z":"","name":"Home 4","icon":"dashboard","disabled":false,"hidden":false}]

So when I paste the equation I don't know why appears something in blank so I need some if about empty field or something.

Sin título

You will need to export and paste here the section of your flow that has the issue. Break it down to the least nodes possibe to create the error.

Also why multiple functon nodes in a row, would be better to combine them as each call to function node has a overhead.

Yeah about the multiple I'm not really good with that stuffs first I test it and then I try to clean my code.

The part is this one...

[{"id":"29e0c364.50619c","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"7.5648x + 13.75","payloadType":"str","x":220,"y":560,"wires":[["c4e70995.1daf08"]]},{"id":"574ecccb.08e414","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":480,"wires":[]},{"id":"acd379c.a365588","type":"ui_text_input","z":"bd64dc92.8bd4b","name":"","label":"","tooltip":"","group":"13bef394.605cfc","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":180,"y":380,"wires":[["c4e70995.1daf08","d948523b.5876e"]]},{"id":"b32478e1.5024e8","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2.1425x + 3.8416","payloadType":"str","x":200,"y":480,"wires":[["c4e70995.1daf08"]]},{"id":"2b79d692.7d5b0a","type":"inject","z":"bd64dc92.8bd4b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4.4607x + 8.3455","payloadType":"str","x":180,"y":520,"wires":[["c4e70995.1daf08"]]},{"id":"57d28e6a.0d59e","type":"function","z":"bd64dc92.8bd4b","name":"","func":"if (!context.outputAlarms) {\n   context.outputAlarms = [];\n}\ncontext.outputAlarms.push(msg.payload);\nmsg.payload = context.outputAlarms;\nreturn msg; ","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":480,"wires":[["5100a8c8.737e88"]]},{"id":"5100a8c8.737e88","type":"function","z":"bd64dc92.8bd4b","name":"","func":"var equa = msg.payload;\n\nglobal.set('equa',equa);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":480,"wires":[["574ecccb.08e414"]]},{"id":"3a1325a6.18b1aa","type":"comment","z":"bd64dc92.8bd4b","name":"equation data in","info":"","x":180,"y":440,"wires":[]},{"id":"c4e70995.1daf08","type":"function","z":"bd64dc92.8bd4b","name":"","func":"var ecuabase = msg.payload;\nvar item = msg.topic;\n\nvar objeto = {\n  equation: ecuabase,\n  variables: item\n};\nmsg.payload = objeto;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":480,"wires":[["57d28e6a.0d59e","3c1cdb2f.b90104"]]},{"id":"d948523b.5876e","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":360,"wires":[]},{"id":"3c1cdb2f.b90104","type":"debug","z":"bd64dc92.8bd4b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":420,"wires":[]},{"id":"13bef394.605cfc","type":"ui_group","z":"","name":"ingreseecuacionesacalibrar","tab":"22ba44f8.aa5d7c","order":2,"disp":true,"width":"6","collapse":false},{"id":"22ba44f8.aa5d7c","type":"ui_tab","z":"","name":"Home 4","icon":"dashboard","disabled":false,"hidden":false}]

if you paste and the you delete what you put it makes an empty equation object. I can put like a button to send my paste equation and it will be send in to the payload?

Not seeing any thing except a text input.

When i typed in text nothing happened. When looking at your code i noticed that it created multiple global context objects. You may want to look into that, as it may need tidying/removing entries.

please try to delete what you put and the paste again

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