List node, get checkbox state

Hi all!
I'm using node-red-node-ui-list for a groceries list. I'm working on a solution to delete an entry as soon as it is checked, or alternatively delete the checked entries as soon as I click on a button.

Can anyone give my an advice how to check the state of the checkbox?

That would really be a big help.

Thanks in advance!

Does it even have a trigger or is it just a design function? Does anyone know? And if it has no trigger, does anyone have another idea how to delete an entry of the list after UI interaction?

Never used it but the readme suggests you can populate the list by a payload AND you can get change events from the "output port"

Based on reading that, you can simply maintain a "todo list" (array) in context and add to / remove from that list based on the events it sends.

Hi Steve-Mcl,
thanks for that hint, it pulls back e.g. the name of the entry in the payload, this is definitively something to work with!

This is what I've done:
I used the output node with a function node, which contains this:

if (msg.payload.isChecked == true){
/* do something */
}
return msg;

that "do something" is: define it as a "has to be deleted", specifically: put a "-" before the name. In my flow every entry, which starts with an "-" will be deleted if available. Than I linked the node to my back to the beginning of my workflow, and: voilá! It works.

1 Like