# Worldmap String Format

**URL:** <https://discourse.nodered.org/t/worldmap-string-format/9783>\
**Category:** General\
**Created:** [4 April 2019 22:09 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783 "2019-04-04T22:09:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrDmx1024](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@MrDmx1024](https://discourse.nodered.org/u/MrDmx1024)\
**Post date:** [4 April 2019 22:09 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783/1 "2019-04-04T22:09:31Z")

</div>

I am using the worldmap node to create pins on a local map of our devices. I have it working fine manually however when one get the info from my locations it is not formatted correctly. Could somebody point me in the correct direction to get the {} around my payload to go into the worldmap?

If I use the inject / payload JSON and put {"name":"cvt", "label":"My Office","lat":36.69, "lon":-93.21} all is good! However when I get this info through my MQTT and back into my server it looks like this

""name":"cvt", "label":"My Office","lat":36.69, "lon":-93.21"

how do I get it back to {"name":"cvt", "label":"My Office","lat":36.69, "lon":-93.21}

Any help would be much appreciated. Thank you

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 April 2019 22:44 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783/2 "2019-04-04T22:44:39Z")

</div>

By default Mqtt delvers strings. Depending on the version of Node-RED you have, you may be able to set it to deliver JSON instead.. If not then the JSON node should fix it for you.

---

<div class="post-metadata">

**Author:** ![MrDmx1024](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@MrDmx1024](https://discourse.nodered.org/u/MrDmx1024)\
**Post date:** [4 April 2019 23:05 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783/3 "2019-04-04T23:05:42Z")

</div>

Thank you dceejay! However I did try the JSON node as that seemed obvious and thats what I have it set to on the inject but I get an error...

"Unexpected token : in JSON at position 6" when I run it through the json node... I know I am missing something simple but its got me.

---

<div class="post-metadata">

**Author:** ![MrDmx1024](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@MrDmx1024](https://discourse.nodered.org/u/MrDmx1024)\
**Post date:** [4 April 2019 23:09 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783/4 "2019-04-04T23:09:10Z")

</div>

Also actually this one line is coming in on an array and I am pulling this one line out as a string. But its got those darn "" around it and they need to be {} LOL

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 April 2019 06:56 UTC](https://discourse.nodered.org/t/worldmap-string-format/9783/5 "2019-04-05T06:56:51Z")

</div>

OK I think we need to see what you are really trying to do. Attach a debug node to the mqtt node and show us the real output.
