# toUpper msg.payload

**URL:** https://discourse.nodered.org/t/toupper-msg-payload/21878
**Category:** General
**Created:** [17 February 2020 17:58 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878 "2020-02-17T17:58:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gbuurman](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@gbuurman](https://discourse.nodered.org/u/gbuurman)
#### Post date: [17 February 2020 17:58 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/1 "2020-02-17T17:58:46Z")

</div>

Hi all, While I am replying to and with Colin (thanks) I am getting another problem:

TypeError: msg.payload.toupper is not a function

Help. first, it worked like a charm and after some reformatting JSON (is ok) I am having this error.

Any suggestion is welcome.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [17 February 2020 18:00 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/2 "2020-02-17T18:00:39Z")

</div>

`toUpper` is a function on String type objects.

If you pass your message to a Debug node, you can check if msg.payload is a string or not.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [17 February 2020 23:10 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/3 "2020-02-17T23:10:34Z")

</div>

Isn't it `.toUpperCase()`?

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [17 February 2020 23:14 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/4 "2020-02-17T23:14:44Z")

</div>

I thought `toUpper` was C++, not javascript??

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [17 February 2020 23:49 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/5 "2020-02-17T23:49:35Z")

</div>

Yup toUpperCase()

> **[String.prototype.toUpperCase()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)**
>
> The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn't one).

---

<div class="post-metadata">

### Author: ![gbuurman](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@gbuurman](https://discourse.nodered.org/u/gbuurman)
#### Post date: [18 February 2020 07:44 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/6 "2020-02-18T07:44:31Z")

</div>

sorry guys, you where right. It should be to uppercase. I should keep myself to one (1) programming language.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 February 2020 13:47 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/7 "2020-02-18T13:47:18Z")

</div>

And don't forget that JavaScript function and variable names are **CASE SENSITIVE**. 😀

> [@gbuurman](#):
>
> I should keep myself to one (1) programming language.

Yup, JavaScript rules them all! 🙀 🤣

---

<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: [18 April 2020 13:47 UTC](https://discourse.nodered.org/t/toupper-msg-payload/21878/8 "2020-04-18T13:47:19Z")

</div>

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