# Boolean logic to value

**URL:** https://discourse.nodered.org/t/boolean-logic-to-value/98726
**Category:** General
**Created:** [18 August 2025 21:22 UTC](https://discourse.nodered.org/t/boolean-logic-to-value/98726 "2025-08-18T21:22:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![martijnspaan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martijnspaan/32/102819_2.png) [@martijnspaan](https://discourse.nodered.org/u/martijnspaan)
#### Post date: [18 August 2025 21:22 UTC](https://discourse.nodered.org/t/boolean-logic-to-value/98726/1 "2025-08-18T21:22:58Z")

</div>

Hi,

I’m trying to do something incredibly simple, but I’m stuck in combining switch and boolean functions which overcomplicate things. Maybe somebody can point me in the right direction, this is what I try to accomplish:  
There is an object with 3 keys

_object_  
Main Salon Door Open: 0  
Main Salon Door Closed: 1  
Main Salon Door Partially Open: 0

each 1 value is excluding the other 2, there can only be one 1 value. as a door can only be in 1 state at the same time.

From these 3 booleans I would like to get single key output with a value according to the following logic  
\*  
object\*  
Main Salon Door Open: if 1 –\> Status: 1  
Main Salon Door Closed: if 1 –\> Status: 2  
Main Salon Door Partially Open: if 1 –\> Status 3

can somebody please tell me the most efficient and simple way to do this?

thanks!

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [18 August 2025 21:39 UTC](https://discourse.nodered.org/t/boolean-logic-to-value/98726/2 "2025-08-18T21:39:17Z")

</div>

This post timed out

---

<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: [16 November 2025 21:39 UTC](https://discourse.nodered.org/t/boolean-logic-to-value/98726/3 "2025-11-16T21:39:19Z")

</div>

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