# \[Solved\] Jsonata function help

**URL:** <https://discourse.nodered.org/t/solved-jsonata-function-help/15953>\
**Category:** General\
**Created:** [26 September 2019 14:54 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953 "2019-09-26T14:54:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![biz](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@biz](https://discourse.nodered.org/u/biz)\
**Post date:** [26 September 2019 14:54 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953/1 "2019-09-26T14:54:11Z")

</div>

Hello all. I have a perplexing issue. Someone on here told me about jsonata and it has been very helpful so far. I am not that advanced yet in it. I have some json output. and I can get the jsonata output that I almost want.  
My current jsonata string is "scanners.[name,last\_connect,status,engine\_version,ui\_version,scan\_count]"

However I have multiple groups with type local or managed. I ONLY want to see items of the above string from type= managed

If I do this it only reports back true or false which is not helpful  
"scanners.[type='managed']&[name,last\_connect,status,engine\_version,ui\_version,scan\_count]"

Is there anyway to filter the json listed below on if type = managed then show name , last\_connect, status, engine\_version, ui\_version, scan\_count  
data fields have been purposely skewed to hide information but the structure is the same

```auto
redacted

```

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 September 2019 15:10 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953/2 "2019-09-26T15:10:33Z")

</div>

Please provide some usable data, the example data above is not valid json.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [26 September 2019 15:17 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953/3 "2019-09-26T15:17:14Z")

</div>

I believe you are very close. It should work if you replace the "&" by a dot

scanners[type='managed'].[name,last\_connect,status,engine\_version,ui\_version,scan\_count]

---

<div class="post-metadata">

**Author:** ![biz](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@biz](https://discourse.nodered.org/u/biz)\
**Post date:** [26 September 2019 16:23 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953/4 "2019-09-26T16:23:00Z")

</div>

> [@bakman2](#):
>
> ple data above is

I can't do that. This is an excerpt of server data and I can't give you the real names.  
It should be still valid json. Will look over it might have accidentally removed a ' or " or ) somewhere upon putting in just jibberish values

---

<div class="post-metadata">

**Author:** ![biz](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@biz](https://discourse.nodered.org/u/biz)\
**Post date:** [26 September 2019 16:24 UTC](https://discourse.nodered.org/t/solved-jsonata-function-help/15953/5 "2019-09-26T16:24:40Z")

</div>

> [@Andrei](#):
>
> scanners[type='managed'].[name,last\_connect,status,engine\_version,ui\_version,scan\_count]

man you're right I was close! thanks for the advice 🙂 🙂 This fixed it 🙂
