# List node, get checkbox state

**URL:** <https://discourse.nodered.org/t/list-node-get-checkbox-state/42933>\
**Category:** Dashboard\
**Created:** [20 March 2021 17:12 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933 "2021-03-20T17:12:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodagrave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodagrave/32/36775_2.png) [@bodagrave](https://discourse.nodered.org/u/bodagrave)\
**Post date:** [20 March 2021 17:12 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/1 "2021-03-20T17:12:04Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![bodagrave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodagrave/32/36775_2.png) [@bodagrave](https://discourse.nodered.org/u/bodagrave)\
**Post date:** [23 March 2021 10:31 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/2 "2021-03-23T10:31:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 March 2021 10:45 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/3 "2021-03-23T10:45:34Z")

</div>

Never used it but the [readme](https://flows.nodered.org/node/node-red-node-ui-list) 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.

---

<div class="post-metadata">

**Author:** ![bodagrave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodagrave/32/36775_2.png) [@bodagrave](https://discourse.nodered.org/u/bodagrave)\
**Post date:** [27 March 2021 23:10 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/4 "2021-03-27T23:10:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![bodagrave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bodagrave/32/36775_2.png) [@bodagrave](https://discourse.nodered.org/u/bodagrave)\
**Post date:** [6 April 2021 11:28 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/5 "2021-04-06T11:28:50Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 April 2021 11:29 UTC](https://discourse.nodered.org/t/list-node-get-checkbox-state/42933/6 "2021-04-20T11:29:07Z")

</div>

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