# Extract a special value from a message

**URL:** <https://discourse.nodered.org/t/extract-a-special-value-from-a-message/21170>\
**Category:** General\
**Created:** [2 February 2020 13:14 UTC](https://discourse.nodered.org/t/extract-a-special-value-from-a-message/21170 "2020-02-02T13:14:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebnerjoh](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@ebnerjoh](https://discourse.nodered.org/u/ebnerjoh)\
**Post date:** [2 February 2020 13:14 UTC](https://discourse.nodered.org/t/extract-a-special-value-from-a-message/21170/1 "2020-02-02T13:14:19Z")

</div>

Hi,

I want to get Webhooks from my Cisco Webex Teams Account without exposing my Node Red installation.

Therefore I registered to node-red-contrib-webhookrelay and I am already receiving messages.

```auto
{"id":"Y2lzY29zcGFyazovL3VzL1dFQkhPT0svMGY1MDBmNTEtMjE5Ni00MWEwLTk0MDUtMmIyNTJkMGIxOGRk","name":"NODE-RED:7a067edd.a87e3","targetUrl":"https://my.webhookrelay.com/v1/webhooks/xyz","resource":"messages","event":"created","orgId":"xyz","createdBy":"xyz","appId":"xyz","ownedBy":"creator","status":"active","created":"2020-02-02T12:32:42.365Z","actorId":"xyz","data":{"id":"this-id-i-want-to-extract","roomId":"xyz","roomType":"group","personId":"Y...

```

I need the second ID, the ID with the value "this-id-i-want-to-extract" as payload.

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

Best Regards,  
Johannes

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [2 February 2020 13:51 UTC](https://discourse.nodered.org/t/extract-a-special-value-from-a-message/21170/2 "2020-02-02T13:51:01Z")

</div>

It looks like that body is a JSON string. Have you tried a change node to move the `msg.payload.body` to `msg.payload`, followed by a JSON node? Afterwards, you put in a debug node again to see how the object is formatted, considering it is a valid json to start with. ~~Looking at the output it could also be that it outputs several JSON objects one after another, but I can't say that for sure from this limited screenshot.~~ Start there, I'd say.  
Okay, I spoke too soon, you have the object mostly included in your post. It's a single JSON object, as text. So after the JSON node you can access the value you need as `msg.payload.data.id`.

---

<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:** [16 February 2020 13:51 UTC](https://discourse.nodered.org/t/extract-a-special-value-from-a-message/21170/3 "2020-02-16T13:51:04Z")

</div>

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