# jsonGet() Need Correct Path Syntax

**URL:** <https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 12, 2023, 7:21pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949 "2023-03-12T19:21:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hwbrill](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hwbrill/32/14377_2.png) [@hwbrill](https://forum.inductiveautomation.com/u/hwbrill)\
**Post date:** [March 12, 2023, 7:21pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/1 "2023-03-12T19:21:01Z")

</div>

I've tried to follow all the examples in this forum to get the function to return the 'cameraId' value from the following json:

> {"dispositions":[{"scannedLabel":"m073770000100000000006700","cameraId":"2023031020313301672","inductNumber":0,"intendedLane":"123","actualLane":"123","labelStatus":"NORMAL","tiltTrayId":"TiltTray"}]}

The following Expression:

> jsonGet({[MQTT Engine]IBM\_MQTT/MHE/SORTER/DISPOSITION},'dispositions')

returns the following:

> [{"scannedLabel":"m073770000100000000006700","cameraId":"2023031020313301672","inductNumber":0,"intendedLane":"123","actualLane":"123","labelStatus":"NORMAL","tiltTrayId":"TiltTray"}]

the following results in an expression error:

> jsonGet({[MQTT Engine]IBM\_MQTT/MHE/SORTER/DISPOSITION},'dispositions.cameraId')

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 12, 2023, 10:07pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/2 "2023-03-12T22:07:56Z")

</div>

![jsonGet problem](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e4ebce7646530e949cc000e325ec62385f9d08c.png)

It looks to me as though the `jsonGet()` function doesn't support nested paths. How did you get it to work at all?

---

<div class="post-metadata">

**Author:** ![hwbrill](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hwbrill/32/14377_2.png) [@hwbrill](https://forum.inductiveautomation.com/u/hwbrill)\
**Post date:** [March 13, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/3 "2023-03-13T14:43:08Z")

</div>

I found a work around. I have a Document Expression Tag: 'dispositions' that has the following expression:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/38564d33d1afafb9b62c514357e6653d08fec01f.jpeg)

The 'dispositions' tag is referenced as the 'Source Tag Path' in a derived tag, 'dispositionTrigger' with the following Read Expression:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54dfa91dfe76665b47167d1dc34ce03ad0cfef13.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 13, 2023, 2:44pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/4 "2023-03-13T14:44:12Z")

</div>

I don't think that's working because the JSON in the first parameter is working because it's being evaluated as a tag path. The nested path error is because of that. Try wrapping your test JSON in single quotes.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 13, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/5 "2023-03-13T14:45:29Z")

</div>

@hwbrill - you just need an array index in your JSON get expression? `dispositions[0].cameraId`.

---

<div class="post-metadata">

**Author:** ![hwbrill](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hwbrill/32/14377_2.png) [@hwbrill](https://forum.inductiveautomation.com/u/hwbrill)\
**Post date:** [March 13, 2023, 3:33pm UTC](https://forum.inductiveautomation.com/t/jsonget-need-correct-path-syntax/70949/6 "2023-03-13T15:33:45Z")

</div>

that works too! Thank you @paul-griffith
