# Shorten message

**URL:** <https://discourse.nodered.org/t/shorten-message/65781>\
**Category:** General\
**Tags:** node-red-dashboard, function-node, mqtt\
**Created:** [29 July 2022 12:22 UTC](https://discourse.nodered.org/t/shorten-message/65781 "2022-07-29T12:22:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)\
**Post date:** [29 July 2022 12:22 UTC](https://discourse.nodered.org/t/shorten-message/65781/1 "2022-07-29T12:22:07Z")

</div>

Hi guys,

i got the following msg from Kodi over MQTT  
"{"val": "Titel"}"

and i just want to see the titel on the Dashboard without the rest.

My function works but its not flexible  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b632478790c7ef70832689fc02df8647cd81d72e.png)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 July 2022 12:24 UTC](https://discourse.nodered.org/t/shorten-message/65781/2 "2022-07-29T12:24:51Z")

</div>

Select output a parse object in the mqtt node.  
then access the value at `msg.payload.val`

---

<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 July 2022 12:24 UTC](https://discourse.nodered.org/t/shorten-message/65781/3 "2022-07-29T12:24:54Z")

</div>

Use a JSON node to change the string to a JS object OR set the MQTT node to parse JSON

Then simply use `msg.payload.val`

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)\
**Post date:** [29 July 2022 12:34 UTC](https://discourse.nodered.org/t/shorten-message/65781/4 "2022-07-29T12:34:29Z")

</div>

Thanks guys, now it works 🙂  
Both answers where perfekt and super fast!

---

<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 August 2022 12:35 UTC](https://discourse.nodered.org/t/shorten-message/65781/5 "2022-08-12T12:35:00Z")

</div>

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