# What's wrong in my flow

**URL:** https://discourse.nodered.org/t/whats-wrong-in-my-flow/20927
**Category:** General
**Created:** [27 January 2020 20:30 UTC](https://discourse.nodered.org/t/whats-wrong-in-my-flow/20927 "2020-01-27T20:30:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![devifast](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@devifast](https://discourse.nodered.org/u/devifast)
#### Post date: [27 January 2020 20:30 UTC](https://discourse.nodered.org/t/whats-wrong-in-my-flow/20927/1 "2020-01-27T20:30:08Z")

</div>

Im verry new in node red . I can't figure out where I'm wrong in this simple flow.  
sorry for my bad english.

[  
{  
"id": "db1e7864.8ec9b8",  
"type": "tab",  
"label": "Flow 1",  
"disabled": false,  
"info": ""  
},  
{  
"id": "af60a6e2.a4a4f8",  
"type": "inject",  
"z": "db1e7864.8ec9b8",  
"name": "temperature",  
"topic": "temperature",  
"payload": "10",  
"payloadType": "num",  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"x": 170,  
"y": 100,  
"wires": [  
[  
"5bc15e67.e87bb"  
]  
]  
},  
{  
"id": "5bc15e67.e87bb",  
"type": "join",  
"z": "db1e7864.8ec9b8",  
"name": "",  
"mode": "custom",  
"build": "object",  
"property": "payload",  
"propertyType": "msg",  
"key": "topic",  
"joiner": "\n",  
"joinerType": "str",  
"accumulate": false,  
"timeout": "",  
"count": "3",  
"reduceRight": false,  
"reduceExp": "",  
"reduceInit": "",  
"reduceInitType": "",  
"reduceFixup": "",  
"x": 370,  
"y": 140,  
"wires": [  
[  
"396d059c.5fa1aa",  
"2b79041b.1cdbdc"  
]  
]  
},  
{  
"id": "396d059c.5fa1aa",  
"type": "debug",  
"z": "db1e7864.8ec9b8",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "payload",  
"targetType": "msg",  
"x": 530,  
"y": 140,  
"wires":   
},  
{  
"id": "166cbaea.6b33d5",  
"type": "inject",  
"z": "db1e7864.8ec9b8",  
"name": "humidity",  
"topic": "humidity",  
"payload": "50",  
"payloadType": "num",  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"x": 160,  
"y": 140,  
"wires": [  
[  
"5bc15e67.e87bb"  
]  
]  
},  
{  
"id": "9a08556a.79f2d8",  
"type": "inject",  
"z": "db1e7864.8ec9b8",  
"name": "pressure",  
"topic": "pressure",  
"payload": "999",  
"payloadType": "num",  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"x": 160,  
"y": 180,  
"wires": [  
[  
"5bc15e67.e87bb"  
]  
]  
},  
{  
"id": "2b79041b.1cdbdc",  
"type": "function",  
"z": "db1e7864.8ec9b8",  
"name": "",  
"func": " if (msg.payload.temperature == 10) && (msg.payload.humidity == 50) {\nmsg.payload = 1;\nreturn msg;\n} \nelse {\nmsg.payload = 0;\nreturn msg;\n}\n\n ",  
"outputs": 1,  
"noerr": 14,  
"x": 550,  
"y": 60,  
"wires": [  
[  
"fe139b61.8e5248"  
]  
]  
},  
{  
"id": "fe139b61.8e5248",  
"type": "debug",  
"z": "db1e7864.8ec9b8",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "true",  
"targetType": "full",  
"x": 740,  
"y": 80,  
"wires":   
}  
]

---

<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: [27 January 2020 21:00 UTC](https://discourse.nodered.org/t/whats-wrong-in-my-flow/20927/2 "2020-01-27T21:00:30Z")

</div>

Hi. Firstly, you should always wrap code in three backticks...

`````  
`code here`  
`````  
However I did notice this...

> [@devifast](#):
>
> if (msg.payload.temperature == 10) && (msg.payload.humidity == 50)

Should be....

```auto
if (msg.payload.temperature == 10 && msg.payload.humidity == 50)

```

---

<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: [27 March 2020 21:00 UTC](https://discourse.nodered.org/t/whats-wrong-in-my-flow/20927/3 "2020-03-27T21:00:32Z")

</div>

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