AutoTools json read can't filter more than 1 filter values

Discussion in 'AutoApps' started by manfredo, Dec 29, 2018.

  1. manfredo

    manfredo New Member

    Joined:
    Aug 6, 2017
    Messages:
    2
    Likes Received:
    0
    In json read I will filter for more than 1 value. I st the filter field to body._id() and the filter value to a,b,c,d,e,f
    I get as result only the first value (a)

    How should I do this filtering?

    here the task:
    test_json-read (317) A1: Variable Set [ Name:%json_file To:{"body":[{"_id":"a","place":{"location":[16.326434779927,48.228884702593],"altitude":227,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:28:75:a4":{"res":{"1546096752":[2.3,73]},"type":["temperature","humidity"]},"70:ee:50:27:6b:ea":{"res":{"1546096469":[1032]},"type":["pressure"]}},"modules":["02:00:00:28:75:a4"],"module_types":{"02:00:00:28:75:a4":"NAModule1"}},{"_id":"b","place":{"location":[16.3357678,48.2265013],"altitude":208,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:13:0b:44":{"res":{"1546096219":[4.2,70]},"type":["temperature","humidity"]},"70:ee:50:13:22:ac":{"res":{"1546096257":[1030.6]},"type":["pressure"]}},"modules":["02:00:00:13:0b:44"],"module_types":{"02:00:00:13:0b:44":"NAModule1"}},{"_id":"c","place":{"location":[16.3404032,48.2184684],"altitude":194,"timezone":"Europe\/Vienna"},"mark":12,"measures":{"02:00:00:22:de:6e":{"res":{"1546095999":[2.6,75]},"type":["temperature","humidity"]},"05:00:00:02:f6:00":{"rain_60min":0,"rain_24h":0.101,"rain_live":0,"rain_timeutc":1546096628},"06:00:00:01:68:36":{"wind_strength":3,"wind_angle":270,"gust_strength":11,"gust_angle":209,"wind_timeutc":1546096628},"70:ee:50:22:ea:f0":{"res":{"1546096629":[1023]},"type":["pressure"]}},"modules":["02:00:00:22:de:6e","05:00:00:02:f6:00","06:00:00:01:68:36"],"module_types":{"02:00:00:22:de:6e":"NAModule1","05:00:00:02:f6:00":"NAModule3","06:00:00:01:68:36":"NAModule2"}},{"_id":"d","place":{"location":[16.3380634,48.2248835],"altitude":210,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:2f:2e:de":{"res":{"1546096366":[2.5,76]},"type":["temperature","humidity"]},"70:ee:50:16:10:b0":{"res":{"1546096406":[1028.1]},"type":["pressure"]}},"modules":["02:00:00:2f:2e:de"],"module_types":{"02:00:00:2f:2e:de":"NAModule1"}},{"_id":"e","place":{"location":[16.344812,48.225342],"altitude":192,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:17:d4:28":{"res":{"1546096282":[3.4,78]},"type":["temperature","humidity"]},"70:ee:50:17:ed:f8":{"res":{"1546096314":[1027.6]},"type":["pressure"]}},"modules":["02:00:00:17:d4:28"],"module_types":{"02:00:00:17:d4:28":"NAModule1"}},{"_id":"f","place":{"location":[16.32518,48.221925],"altitude":205,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:02:dc:7c":{"res":{"1546096042":[4.1,68]},"type":["temperature","humidity"]},"70:ee:50:03:06:1e":{"res":{"1546096084":[1031.3]},"type":["pressure"]}},"modules":["02:00:00:02:dc:7c"],"module_types":{"02:00:00:02:dc:7c":"NAModule1"}},{"_id":"g","place":{"location":[16.3402972,48.2184846],"altitude":194,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:2b:32:60":{"res":{"1546096770":[2.6,78]},"type":["temperature","humidity"]},"70:ee:50:2b:48:06":{"res":{"1546096488":[1020.8]},"type":["pressure"]}},"modules":["02:00:00:2b:32:60"],"module_types":{"02:00:00:2b:32:60":"NAModule1"}},{"_id":"h","place":{"location":[16.327672,48.22758],"altitude":223,"timezone":"Europe\/Vienna"},"mark":15,"measures":{"02:00:00:27:32:ee":{"res":{"1546096303":[2.2,65]},"type":["temperature","humidity"]},"70:ee:50:27:5d:e6":{"res":{"1546096324":[1029.9]},"type":["pressure"]}},"modules":["02:00:00:27:32:ee"],"module_types":{"02:00:00:27:32:ee":"NAModule1"}},{"_id":"i","place":{"location":[16.3487184,48.2211536],"altitude":193,"timezone":"Europe\/Vienna"},"mark":13,"measures":{"02:00:00:13:70:96":{"res":{"1546096711":[3.6,69]},"type":["temperature","humidity"]},"70:ee:50:13:88:ea":{"res":{"1546096732":[1027.4]},"type":["pressure"]}},"modules":["02:00:00:13:70:96"],"module_types":{"02:00:00:13:70:96":"NAModule1"}}],"status":"ok","time_exec":0.027199983596802,"time_server":1546096824} Recurse Variables:Off Do Maths:Off Append:Off ] A2: Variable Set [ Name:%ausschluss To:a,b,c,d,e,f Recurse Variables:Off Do Maths:Off Append:Off ] A3: AutoTools Json Read [ Configuration:Input Format: Json Json: %json_file Fields: body._id(),body.place.location() Filter Fields: body._id() Filter Values: %ausschluss Separator: , Timeout (Seconds):60 ] A4: Flash [ Text:result: id's %body__id(#) names %body__id() should be: id's 6 names a,b,c,d,e,f Long:On ]
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    7,407
    Likes Received:
    638
    You can only use one filter value for each filter field. If you need to filter the same field by multiple values you should use regex :)
     
  3. manfredo

    manfredo New Member

    Joined:
    Aug 6, 2017
    Messages:
    2
    Likes Received:
    0
    thank you, will try it ;)
     

Share This Page