# Json evaluate id

**URL:** <https://discourse.gohugo.io/t/json-evaluate-id/18382>\
**Category:** support\
**Created:** [April 27, 2019, 6:10pm UTC](https://discourse.gohugo.io/t/json-evaluate-id/18382 "2019-04-27T18:10:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![argus](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@argus](https://discourse.gohugo.io/u/argus)\
**Post date:** [April 27, 2019, 6:10pm UTC](https://discourse.gohugo.io/t/json-evaluate-id/18382/1 "2019-04-27T18:10:29Z")

</div>

Hello, how can i evaluate an id from a json api ?

i have a list like this

```auto
visible_instructors:[{}]
[{
  "id": 0,
  "parent": 2,
  "name": "Grand Child 1"
}, {
  "id": 1,
  "parent": 2,
  "name": "Grand Child 2"
}]

```

so when i call it like that

```auto
{{ $json.visible_instructors[""0""].name }}

```

i get the error

```auto
 bad character U+005B '['  

```

i wonder how i could escape the 0 id

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [April 27, 2019, 7:29pm UTC](https://discourse.gohugo.io/t/json-evaluate-id/18382/2 "2019-04-27T19:29:15Z")

</div>

> [@argus](#):
>
> {{ $json.visible\_instructors["“0"”].name }}

I’m not familiar with this syntax, is that some kind of `javascript`’s `map.filter()`?

This look like you are not targeting the `id` key here, but rather the index which coincidently in your example are the same.

In go Template, you cannot access an array element this way, you have to use [`index`](https://gohugo.io/functions/index-function/#readout):

```auto
{{ (index $json.visible_instructors 0).name }}

```

---

<div class="post-metadata">

**Author:** ![argus](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@argus](https://discourse.gohugo.io/u/argus)\
**Post date:** [April 27, 2019, 8:58pm UTC](https://discourse.gohugo.io/t/json-evaluate-id/18382/3 "2019-04-27T20:58:53Z")

</div>

it works, thanks a million!!
