# Handling the statusCode

**URL:** <https://discourse.nodered.org/t/handling-the-statuscode/92142>\
**Category:** General\
**Created:** [2 October 2024 23:30 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142 "2024-10-02T23:30:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdrianoOPereira](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/adrianoopereira/32/93705_2.png) [@AdrianoOPereira](https://discourse.nodered.org/u/AdrianoOPereira)\
**Post date:** [2 October 2024 23:30 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142/1 "2024-10-02T23:30:31Z")

</div>

Hello Guys!  
I'm using a Siemens clp to call an endpoint on the http request node, but I need to turn on a lamp on the clp when the statusCode is not 200.  
Could anyone help how to handle a statusCode output?

---

<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:** [3 October 2024 00:01 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142/2 "2024-10-03T00:01:09Z")

</div>

Presumably `statusCode` is returned as `msg.statusCode` similar to this HTTP request:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9ef58ff5b12b3c78916cfec4400798c6ac2df048.png)

In which case you just need a switch node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8b3d6c809d50d90749a6c4178b9199eaa0b8301.png)

Of course how to turn on a lamp on the clp (whatever that is) may be more complex.

---

<div class="post-metadata">

**Author:** ![AdrianoOPereira](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/adrianoopereira/32/93705_2.png) [@AdrianoOPereira](https://discourse.nodered.org/u/AdrianoOPereira)\
**Post date:** [6 October 2024 18:33 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142/4 "2024-10-06T18:33:47Z")

</div>

In this case, can I use the dashboard to create an alarm and take the necessary measures such as a latency and check as soon as possible?

---

<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:** [6 October 2024 19:36 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142/5 "2024-10-06T19:36:06Z")

</div>

Bearing in mind that I don't know what a Siemens clp is, nor how to turn on a lamp on it...

> [@AdrianoOPereira](#):
>
> can I use the dashboard to create an alarm

Do you mean like a popup message on the Node-red dashboard (Which is not the same thing as the Node-red editor)?  
Yes you can. There is a notification node for both the original and new dashboards.

You could also use the email node to send an email notification, or Telegram. There are third party SMS services available that you could activate too.

> [@AdrianoOPereira](#):
>
> necessary measures such as a latency

I do not understand.

> [@AdrianoOPereira](#):
>
> check as soon as possible?

Any nodes connected to the switch node that tests msg.statusCode will be triggered immediately.

---

<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:** [4 January 2025 19:36 UTC](https://discourse.nodered.org/t/handling-the-statuscode/92142/6 "2025-01-04T19:36:32Z")

</div>

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