# Help on json script filter

**URL:** <https://community.homey.app/t/help-on-json-script-filter/73545>\
**Category:** Questions & Help\
**Created:** [December 13, 2022, 3:07pm UTC](https://community.homey.app/t/help-on-json-script-filter/73545 "2022-12-13T15:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thekos/32/33969_2.png) [@TheKos](https://community.homey.app/u/TheKos)\
**Post date:** [December 13, 2022, 3:07pm UTC](https://community.homey.app/t/help-on-json-script-filter/73545/1 "2022-12-13T15:07:04Z")

</div>

I have figured out how to read a logic variable in a homey script using a for loop.  
But I think it should also be possible and more efficient by using a filter.  
However I have tried some variants without succes. See the example  
// Get all logic  
let logvars = await Homey.logic.getVariables()  
[//console.log](https://console.log)(logvars);  
for (const logvar of Object.values(logvars)) {  
if (logvar.name===“radiatorhoog”) {  
log('\n found logic var '+ logvar.name + "temp is " +logvar.value);}  
}  
//now trying a filter  
const advancedvar = await Homey.logic.getVariables(({filter: { name: “radiatorhoog” }}));  
console.log(‘adva’ + advancedvar);

And the output is  
found logic var radiatorhoogtemp is 20  
adva[object Object]

So the filter is not working. Any ideas ?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [December 13, 2022, 3:28pm UTC](https://community.homey.app/t/help-on-json-script-filter/73545/2 "2022-12-13T15:28:45Z")

</div>

> [@TheKos](#):
>
> So the filter is not working

Try logging it properly:

```auto
console.log('adva', advancedvar)

```

---

<div class="post-metadata">

**Author:** ![TheKos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thekos/32/33969_2.png) [@TheKos](https://community.homey.app/u/TheKos)\
**Post date:** [December 13, 2022, 5:19pm UTC](https://community.homey.app/t/help-on-json-script-filter/73545/3 "2022-12-13T17:19:22Z")

</div>

How simple can it be, thanks a lot for helping me out. 😀
