# Having trouble parsing this message

**URL:** https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171
**Category:** General
**Created:** [29 August 2020 04:01 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171 "2020-08-29T04:01:37Z")
**Posts on this page:** 10
**Page:** 2

<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: [29 August 2020 08:43 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/21 "2020-08-29T08:43:39Z")

</div>

> [@Colin](#):
>
> I don't even know what "contains" means if the type is number.

if the incoming value (e.g. ms.payload.code) is a number then it will get cast to a string for the `contains` operation

Simple answer - it IS a number in the debug output, use number type in the switch comparison value

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 August 2020 08:43 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/22 "2020-08-29T08:43:53Z")

</div>

> [@Steve-Mcl](#):
>
> in other words, it IS / WAS a number so use the `==` number in the switch (not contains)

And when I do that, **nothing** goes through the `switch` node.

So I tried to work out what is/was going on.

---

<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: [29 August 2020 08:45 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/23 "2020-08-29T08:45:34Z")

</div>

Try again - be certain to set the comparator to number type

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d4867e568bf92138048d37fb18d1b2e676dd166a.png)

the debug definitely shows a number.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a1d6eac28bc50e837a46c59e4fd91293af776c5.png)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 August 2020 08:45 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/24 "2020-08-29T08:45:44Z")

</div>

I am so nearly tempted to set up my camera and record the screen, but the file size would probably be too big and not really achieve much.

---

<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: [29 August 2020 08:45 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/25 "2020-08-29T08:45:50Z")

</div>

Can you post a flow of the exec node up to the failing switch node please?

---

<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: [29 August 2020 08:49 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/26 "2020-08-29T08:49:39Z")

</div>

> [@Trying\_to\_learn](#):
>
> tempted to set up my camera and record the screen

No need - use [peek](https://www.youtube.com/watch?v=_FmhvkYJqvM)

[install instructions](https://vitux.com/install-peek-animated-gif-recorder-on-ubuntu/)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 August 2020 08:50 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/27 "2020-08-29T08:50:29Z")

</div>

ARGH ARGH ARGH!

I don't know how or why, I did it for the sake of indulging you - though I have done it 3 times before - and now it works.

Sorry folks.

---

<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: [29 August 2020 08:51 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/28 "2020-08-29T08:51:15Z")

</div>

You probably had the comparator set to string 🤷‍♂️

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [29 August 2020 08:52 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/29 "2020-08-29T08:52:52Z")

</div>

Can't say. It was set to number.

 ![Screenshot from 2020-08-29 18-46-11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15fc9ccc1180ba50dfe07294b152c6ddd48ec274.png)

But I am not going to argue.

All I did then was change it form `contains` to `==`

---

<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: [12 September 2020 08:52 UTC](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171/30 "2020-09-12T08:52:53Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/having-trouble-parsing-this-message/32171.md?page=1)
