# Logical And Function

**URL:** https://discourse.nodered.org/t/logical-and-function/70093
**Category:** General
**Created:** [4 November 2022 17:26 UTC](https://discourse.nodered.org/t/logical-and-function/70093 "2022-11-04T17:26:20Z")
**Posts on this page:** 6
**Page:** 4

<div class="post-metadata">

### Author: ![HansZnarf](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansznarf/32/70215_2.png) [@HansZnarf](https://discourse.nodered.org/u/HansZnarf)
#### Post date: [5 December 2022 18:12 UTC](https://discourse.nodered.org/t/logical-and-function/70093/61 "2022-12-05T18:12:56Z")

</div>

Colin: Have started to view. Issue is that they go over items I already know and include others without enough detail for me to understand. We all learn differently. I learn a bit better with mentoring than videos sometimes.

Thanks,  
Hans.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [5 December 2022 20:55 UTC](https://discourse.nodered.org/t/logical-and-function/70093/62 "2022-12-05T20:55:18Z")

</div>

Go through the videos first, it will be time well spent, you can always skip over bits you already know. Watch out for the one on working with messages, that should help you to understand message properties.

---

<div class="post-metadata">

### Author: ![HansZnarf](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansznarf/32/70215_2.png) [@HansZnarf](https://discourse.nodered.org/u/HansZnarf)
#### Post date: [6 December 2022 14:53 UTC](https://discourse.nodered.org/t/logical-and-function/70093/63 "2022-12-06T14:53:36Z")

</div>

Colin: Will do - Thanks

---

<div class="post-metadata">

### Author: ![HansZnarf](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hansznarf/32/70215_2.png) [@HansZnarf](https://discourse.nodered.org/u/HansZnarf)
#### Post date: [7 December 2022 15:48 UTC](https://discourse.nodered.org/t/logical-and-function/70093/64 "2022-12-07T15:48:37Z")

</div>

Wish to thank the whole team of people who have assisted with this issue and for putting up with my leaning curve.

Hans

---

<div class="post-metadata">

### Author: ![tree-frog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tree-frog/32/89303_2.png) [@tree-frog](https://discourse.nodered.org/u/tree-frog)
#### Post date: [8 December 2022 00:54 UTC](https://discourse.nodered.org/t/logical-and-function/70093/65 "2022-12-08T00:54:38Z")

</div>

locate the message variaables which you want to AND. When your message contains these variables all you need to do is address them and pull them out of the message. Your function can do the logical expression on your boolean values. I'm assuming it's AND. Then your result is your output. You can put the result in the payload to pass it to whatever you have to handle your result logic. Do not make it difficult. It seems that you should model your input. If that message is what you need to start from, then use that message. Make sure you start simple with just one variable then go bigger to arays and then objects. Put that exact string in a JSON object in an inject and insert that to your logic.

---

<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: [6 February 2023 00:54 UTC](https://discourse.nodered.org/t/logical-and-function/70093/66 "2023-02-06T00:54:55Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/logical-and-function/70093.md?page=3)
