# How to get the particular item value from json?

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [March 12, 2020, 4:42pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046 "2020-03-12T16:42:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 4:42pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/1 "2020-03-12T16:42:51Z")

</div>

I am passing my row data of table to other view by using onRowClicked event in table. Row values are passed in the form of json, how can I get individual item value from that json format?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 12, 2020, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/2 "2020-03-12T17:05:48Z")

</div>

I’m not sure this is what you need here, but I think you should try `system.util.jsonDecode()`  
[https://docs.inductiveautomation.com/display/DOC79/system.util.jsonDecode](https://docs.inductiveautomation.com/display/DOC79/system.util.jsonDecode)  
EDIT: I’m not sure this is available in Perspecitive

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:08pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/3 "2020-03-12T17:08:31Z")

</div>

I tried it, didn’t work for me. I think its not supported in perspective.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 12, 2020, 5:10pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/4 "2020-03-12T17:10:18Z")

</div>

Did it error out, or did it just not work. If it didn’t cause an error message, I would expect the syntax was wrong.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:15pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/5 "2020-03-12T17:15:37Z")

</div>

![er](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3beffa4706dcef726b810fd249702d6f49164d72.png)  
causing error, above is the screen shot of log error message

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 12, 2020, 5:17pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/6 "2020-03-12T17:17:46Z")

</div>

Posting your script will help the most, if you don’t mind.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:20pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/7 "2020-03-12T17:20:00Z")

</div>

ya sure

 ![xfvb](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4882e2491ea87bcec881ca9549bad45f35d5f098.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 12, 2020, 5:25pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/8 "2020-03-12T17:25:36Z")

</div>

try this as the first line of your message handler:

```auto
system.perspective.print(type(payload['rowData'])) # and look in Designer Console

```

You’re probably sending Qualified Values, when you should probably just be sending the plain values.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:40pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/9 "2020-03-12T17:40:58Z")

</div>

since i am sending json data as message it will not work in designer console.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f57ceb8e49e3fd58b1f7513311ec077f69725fdf.png)

Below is my tables onRowClicked event

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/611e534efa01760ecebe10852fcfbfd6774696d1.png)

when i am trying to output json in label in other view using below code it prints all json file data but i just need one item from it.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/ca6efdc1b49f85838ec5ed4ec21b040862bd5da3.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 12, 2020, 5:45pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/10 "2020-03-12T17:45:38Z")

</div>

You cannot run system.perspective scripts in the Script Console.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 12, 2020, 5:47pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/11 "2020-03-12T17:47:39Z")

</div>

I intended for you to include that line of code as part of the message handler.

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:50pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/12 "2020-03-12T17:50:36Z")

</div>

like this right?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6ca3cccd2f507bde9fbb4732c4003e457e836a65.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 12, 2020, 5:55pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/13 "2020-03-12T17:55:01Z")

</div>

Yes, but your later post convinces me you’re receiving the data correctly. To reference the data in the received json, you just need to supply the key, which is the key used in the row. Using the default data of the table,  
 ![34%20AM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4aa04a683631a8a952ccd82c227cfb81d896a47d.png)  
you would do this to get the city value:

```auto
payload['rowData']['city']

```

---

<div class="post-metadata">

**Author:** ![ptchanchal](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@ptchanchal](https://forum.inductiveautomation.com/u/ptchanchal)\
**Post date:** [March 12, 2020, 5:58pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-particular-item-value-from-json/33046/14 "2020-03-12T17:58:45Z")

</div>

Ya, it worked thank you so much
