# Expression language: lookup equivalent for json arrays

**URL:** <https://forum.inductiveautomation.com/t/expression-language-lookup-equivalent-for-json-arrays/70233>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [February 23, 2023, 4:47pm UTC](https://forum.inductiveautomation.com/t/expression-language-lookup-equivalent-for-json-arrays/70233 "2023-02-23T16:47:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [February 23, 2023, 4:47pm UTC](https://forum.inductiveautomation.com/t/expression-language-lookup-equivalent-for-json-arrays/70233/1 "2023-02-23T16:47:31Z")

</div>

I have a tag, say `tableTag`, which is of type `Document`: it's an array of json objects, all objects with the same structure. I'd like to define some more tags which are expression tags and get their value from `tableTag` looking up a value in a key of the `tableTag` objects That looks like looking up a value in a dataset, but whereas the _expression language_ has a `lookup` function for `datasets`, I cannot seem to find an equivalent function for json arrays. I developed a python script function of my own, called `jsLookup` and it works. But if I want to use it in an expression tag, my project must be the _Gateway Scripting Project_ and that's not possible.

Any suggestion, except going back to datasets?

Thanks, regards

---

<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:** [February 23, 2023, 5:17pm UTC](https://forum.inductiveautomation.com/t/expression-language-lookup-equivalent-for-json-arrays/70233/2 "2023-02-23T17:17:27Z")

</div>

There's no `lookup` equivalent, but I think an expression like `{document}[indexOf({lookup})]` might work? Subscripts and the `indexOf` function should both work on arrays and documents.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 23, 2023, 5:17pm UTC](https://forum.inductiveautomation.com/t/expression-language-lookup-equivalent-for-json-arrays/70233/3 "2023-02-23T17:17:27Z")

</div>

Sounds like a job for a utility module....
