# Obtaining a seated value from a JSON array on a localhost website

**URL:** https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576
**Category:** General
**Created:** [29 March 2019 13:37 UTC](https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576 "2019-03-29T13:37:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [29 March 2019 13:37 UTC](https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576/1 "2019-03-29T13:37:32Z")

</div>

I have set up a localhost website on a windows 10 computer and I wish to serve the JSON array to an HTTP node in node red. Whilst I can access the ip address index file from the HTTP node okay I am unsure how I drill down to obtain items in the array. Localhost is as below;  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fa9e868669384d909dd6531ac2c3c1b339f9112f.png)

And current node set up worth [""0""].Channel being the path to the array item when I hover over the first item in the list.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/78a75dc34d3a265fc783daadad55c7b46ba36e63.png)

Any help would be greatly appreciated.

---

<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: [29 March 2019 13:41 UTC](https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576/2 "2019-03-29T13:41:57Z")

</div>

The HTTP Request node's URL field can use the mustache syntax to insert msg properties into the url.

The sidebar help for the node says this:

> When configured within the node, the URL property can contain [mustache-style](http://mustache.github.io/mustache.5.html) tags. These allow the url to be constructed using values of the incoming message. For example, if the url is set to `example.com/{{{topic}}}` , it will have the value of `msg.topic` automatically inserted. Using {{{...}}} prevents mustache from escaping characters like / & etc.

The key thing is the use of the `{{ }} ` to indicate where the message property should be inserted.

So for your url, you'd want to use:

```plaintext
http://192.168.1.121/{{payload[0].Channel}}/Channel

```

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [29 March 2019 13:54 UTC](https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576/3 "2019-03-29T13:54:17Z")

</div>

> [@knolleary](#):
>
> [http://192.168.1.121/{{payload[0].Channel}](http://192.168.1.121/%7B%7Bpayload%5B0%5D.Channel%7D)}/Channel

Thanks Nick,

Unfortunately that didn't work and the same error message was returned.

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [30 March 2019 11:06 UTC](https://discourse.nodered.org/t/obtaining-a-seated-value-from-a-json-array-on-a-localhost-website/9576/4 "2019-03-30T11:06:25Z")

</div>

Does the index.php file need to format the JSON output to Mustache template for the HTTP url GET method to work?
