Etable dynamic editorparam

hi guys,
I need to select one option in etable, but this option is dynamic and arrive in the message.

static option:
Captura3

dyanmic option:(this is example)
Captura1

[{"id":"dc82b683.d8aa18","type":"function","z":"cd4a9cc8.24c9a","name":"LEER_CODIGOS_DE_PARADA","func":"Instruccion = \"SELECT * FROM IOTCAU;\";\n\nmsg.topic= Instruccion;\n\nreturn msg;\n","outputs":1,"noerr":0,"x":603.7657928466797,"y":1000.7499494552612,"wires":[["66de576d.fc4ea8"]]},{"id":"66de576d.fc4ea8","type":"mysql","z":"cd4a9cc8.24c9a","mydb":"2fe39f59.0d672","name":"","x":932.7658061981201,"y":1001.7500247955322,"wires":[["bde19f6d.9073","19363107.1bce6f","1ec863dc.72b81c"]]},{"id":"bde19f6d.9073","type":"ui_etable","z":"cd4a9cc8.24c9a","payload":"[{\"title\":\"FASE\",\"field\":\"Fase\",\"editor\":false,\"width\":90,\"align\":\"right\",\"headerVisible\":false},{\"title\":\"CAUSA\",\"field\":\"Causa\",\"editor\":false,\"width\":350,\"align\":\"left\",\"headerVisible\":false},{\"title\":\"T. EJECUCION\",\"field\":\"Tiempo ejec\",\"editor\":false,\"width\":140,\"align\":\"right\",\"headerVisible\":false},{\"title\":\"RENDIMIENTO\",\"field\":\"Rdto_op\",\"editor\":false,\"width\":140,\"align\":\"right\",\"headerVisible\":false}]","payloadType":"json","options":"{\"height\":\"500px\",\"layout\":\"fitColumns\",\"headerVisible\":true}","group":"c3d7d3f.e6afc3","name":"CODIGOS_DE_PARADA","order":8,"width":"14","height":"10","columns":[],"outputs":1,"cts":false,"x":1299.5081024169922,"y":1003.5234022140503,"wires":[[]]},{"id":"19363107.1bce6f","type":"debug","z":"cd4a9cc8.24c9a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1600.6668510437012,"y":904.6667318344116,"wires":[]},{"id":"1ec863dc.72b81c","type":"ui_etable","z":"cd4a9cc8.24c9a","payload":"[{\"title\":\"OPERARIO\",\"field\":\"Operario\",\"editor\":false,\"width\":150,\"align\":\"right\",\"headerVisible\":false},{\"title\":\"HORA INICIO\",\"field\":\"HoraInicio\",\"editor\":false,\"width\":150,\"align\":\"left\",\"headerVisible\":false},{\"title\":\"HORA FIN\",\"field\":\"HoraFin\",\"editor\":false,\"width\":150,\"align\":\"right\",\"headerVisible\":false},{\"title\":\"CAUSA\",\"field\":\"CausaParada\",\"editor\":\"select\",\"width\":100,\"align\":\"right\",\"headerVisible\":true,\"editorParams\":{\"HoraInicio\":[]}}]","payloadType":"json","options":"{\"height\":\"500px\",\"layout\":\"fitColumns\",\"headerVisible\":true}","group":"c3d7d3f.e6afc3","name":"REGISTRO_DE_PARADA","order":8,"width":"12","height":"10","columns":[],"outputs":1,"cts":false,"x":1315.6669120788574,"y":904.6667037010193,"wires":[["19363107.1bce6f"]]},{"id":"a924656.364d298","type":"function","z":"cd4a9cc8.24c9a","name":"LEER REGISTRO DE PARADAS","func":"\nInstruccion = \"SELECT * FROM RegistroParadas;\";\nmsg.topic = Instruccion;\n\nreturn msg;\n","outputs":1,"noerr":0,"x":604.6667060852051,"y":905.666672706604,"wires":[["f099a9fd.2183e8"]]},{"id":"f099a9fd.2183e8","type":"mysql","z":"cd4a9cc8.24c9a","mydb":"c9bfae9d.a5899","name":"","x":936.6666946411133,"y":904.6666884422302,"wires":[["1ec863dc.72b81c"]]},{"id":"579e5445.8312cc","type":"inject","z":"cd4a9cc8.24c9a","name":"","topic":"","payload":"","payloadType":"date","repeat":"20","crontab":"","once":false,"onceDelay":0.1,"x":224.765625,"y":905.7499408721924,"wires":[["a924656.364d298"]]},{"id":"ced1f6c.fa6ea08","type":"inject","z":"cd4a9cc8.24c9a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"30","x":233.87905883789062,"y":998.941424369812,"wires":[["dc82b683.d8aa18"]]},{"id":"2fe39f59.0d672","type":"MySQLdatabase","z":"","name":"","host":"192.168.2.121","port":"3360","db":"PLC","tz":"","charset":""},{"id":"c3d7d3f.e6afc3","type":"ui_group","z":"","name":"REGISTROS DE PARADA","tab":"87a1e3fe.5548b","order":3,"disp":true,"width":"27","collapse":false},{"id":"c9bfae9d.a5899","type":"MySQLdatabase","z":"","name":"","host":"localhost","port":"3306","db":"COR3582","tz":"","charset":""},{"id":"87a1e3fe.5548b","type":"ui_tab","z":"","name":"REGISTRO DE PARADAS","icon":"dashboard","disabled":false,"hidden":false}]

I need to change the static values ​​for dynamic values
msg.payload[0].Fase .... msg.payload[1].Fase .....

is this possible?

Could you give some more detail? For instance, I for one, have no idea what etable is.

It would also help if you showed the entire message and an example of what you mean about changing the static values to dynamic values. What dynamic value?

An export of your flow might be helpful too, in order to make code more readable and importable it is important to surround your code with three backticks
```
like this
```

You can edit and correct your post by clicking the pencil icon.

See this post for more details - How to share code or flow json

Modified. Thanks
I hope you can help me

You have added the backticks after the flow but not before.

what is etable?
go back and reread the post about sharing your code.

create a demo flow showing the issue. Use an inject or template to provide the incoming data - after all, No one else has access to your daabase

as for changing the data, anything is possible you just have to define what needs to be changed to what.

Hi,
this is the sample code.
I need the values in column 3 to be selectable by the values .... payload .Phase.

[{"id":"88d6b865.9b6a08","type":"ui_etable","z":"ccd07d4.255298","payload":"[{\"title\":\"col1\",\"field\":\"Code\",\"width\":\"10%\",\"editor\":false},{\"title\":\"Col2\",\"field\":\"Prty\",\"width\":\"80%\",\"editor\":false},{\"title\":\"Col3\",\"field\":\"Fase\",\"editor\":\"select\",\"editorParams\":{\"values\":[\"NEW\",\"UPDATED\",\"CANCELED\"]}}]","payloadType":"json","options":"{\"movableColumns\":true,\"layout\":\"fitColumns\",\"pagination\":\"local\",\"height\":\"700px\"}","group":"13bb5f9c.48a68","name":"","order":2,"width":"20","height":"7","columns":[],"outputs":1,"cts":false,"x":655,"y":200,"wires":[["f79698a3.e4bc88"]],"l":false},{"id":"2d1616f7.7c5dca","type":"function","z":"ccd07d4.255298","name":"","func":"msg.payload = [\n{ \"Code\":\"0\",  \"Prty\" : \"3122\",    \"Fase\" : 'A'},\n{ \"Code\":\"1\",  \"Prty\" : \"2345\",    \"Fase\" : 'B'},\n{ \"Code\":\"2\",  \"Prty\" : \"3636\",    \"Fase\" : 'C'},\n{ \"Code\":\"3\",  \"Prty\" : \"3322\",    \"Fase\" : 'D'},\n{ \"Code\":\"4\",  \"Prty\" : \"3234\",    \"Fase\" : 'E'},\n{ \"Code\":\"5\",  \"Prty\" : \"hola\",    \"Fase\" : 'F'},\n{ \"Code\":\"6\",  \"Prty\" : \"hello\",    \"Fase\" : 'G'}];\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":200,"wires":[["88d6b865.9b6a08","282c14f6.286c2c"]]},{"id":"f79698a3.e4bc88","type":"ui_text","z":"ccd07d4.255298","group":"13bb5f9c.48a68","order":2,"width":"8","height":"3","name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":1010,"y":200,"wires":[]},{"id":"308ea427.1438ac","type":"inject","z":"ccd07d4.255298","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":220,"y":200,"wires":[["2d1616f7.7c5dca"]]},{"id":"282c14f6.286c2c","type":"debug","z":"ccd07d4.255298","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":300,"wires":[]},{"id":"13bb5f9c.48a68","type":"ui_group","name":"test","tab":"700e0299.f39d8c","order":1,"disp":true,"width":"20","collapse":false},{"id":"700e0299.f39d8c","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Thanks,
I modified the text
Hope it's understandable

Have you looked at the example flow? Node-Red-Contrib-UI-Etable Example1 (flow) - Node-RED

I'm still not clear on what you are trying to do. Could you walk it thru step by step? I see in you r flow you

  1. inject a msg.payload with a boolean true
  2. next comes a function node that you hard code a table of seven (7) rows
  3. that is sent to the etable node and shows up - in the dashboard - with the data from the function node

And in that table you if you click on an item in col3 of any row, a drop down appears.

So what do you want it to do?

Hello,

This is an example that summarizes my problem.
I need to generate a table where the values ​​of a column are selectable.
But the values ​​to select come from a msg. These would be the ones that I now show in column 3.

Therefore, the values ​​that I show in column 3 would be those that should appear in the selection of each box.

Captura4

Therefore in this example for the first row of column 3 the values ​​to select would be A, B, C, D ...

From what I can see (without digging into the node's code) you can't do it. You would have to define thoes options in the eetable node's 'Columns' option.

This node is very lacking in documentation but you could try asking the author on the node's GitHub page.

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