# \[APP\]\[Pro\] JSON Handler and Manipulator

**URL:** <https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317>\
**Category:** Apps\
**Tags:** app, tools, homey-pro\
**Created:** [July 21, 2022, 9:01am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317 "2022-07-21T09:01:57Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [September 20, 2022, 6:46am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/21 "2022-09-20T06:46:07Z")

</div>

> [@Anders\_Gregow](#):
>
> So the Homey code requires the tags from an action card must have static result tag(s)?!  
> This is why you have different sizes of JSON handler cards.

Indeed, and also the arguments are not dynamic, but fortunately, they can be optional nowadays.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [October 5, 2022, 5:05pm UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/22 "2022-10-05T17:05:14Z")

</div>

I just created Loop cards, which will itterate through an Json Array or Collection:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/6/064fdddb6b1a8497bfa762d5f066291cca344456.png)

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/1/c1d3806e1cb2d4cd20f33439aab082d185fcb075.png)

In test now!

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 1, 2022, 9:23am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/23 "2022-11-01T09:23:49Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> I just created Loop cards, which will itterate through an Json Array or Collection:

Maybe you could explain this a bit more? 😉

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 1, 2022, 9:57am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/24 "2022-11-01T09:57:23Z")

</div>

> [@Anders\_Gregow](#):
>
> Maybe you could explain this a bit more? 😉

Yeah, but i find it a bit hard to explain in a non-developer way.  
I just updated a few flowcard-descriptions which are in test right now.

Essentially, i created a `loop` card, or `for each`

```auto
for (var (item,key,index) in Collection) {
}

```

It works pretty easy, you need two cards:

- A When/Trigger Card, which will be triggered for each item in the collection, with these tokens:
  - Item as Text
  - Item as Number
  - Item as Yes/No
  - Key
  - Index
  - Text 1 (argument)

- And a Then/Action Card, which you supply with an (json) collection (array or obj) and an optional argument.  
The When card will be execute for each item in the collection, with the supplied tokens.

### Example

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/a/ba885387d96fb64e5367ccced7e546d29357a714.png)

The bottom card will execute the above (Trigger/When) card three times.  
Result:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/f/cf1fac5592f2e1bf2d0debed06e616bcf84856b8.png)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 1, 2022, 10:00am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/25 "2022-11-01T10:00:28Z")

</div>

Here is another example:

> [@\[APP\]\[Pro\] FTP Client - Control FTP Servers through a directory-based UI in the Homey App or Web App](https://community.homey.app/t/app-pro-ftp-client-control-ftp-servers-through-a-directory-based-ui-in-the-homey-app-or-web-app/70876/62):
>
> Okay, next up: Flowcard: You can retrieve all files from a folder as JSON Array/Collection. Flowcard: Get a Image Token from path. This one is actually the same flowcard as Get Image Token from dropdown, i added a optional sub-path to it). What can you do with it (not write yet, that’s next @B3rt wink ) : You can Loop through all files in a folder and do something with the images, like send them to your phone, or (maybe later) save them on an external FTP somewhere. You can also loop thro…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/d/ad71c5d50098d5deff5a52209610b461a9d4ba12.png)

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 1, 2022, 10:08am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/26 "2022-11-01T10:08:50Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Yeah, but i find it a bit hard to explain in a non-developer way.

Developer-way works fine for me at least. Am a SW developer myself, but only C, C++, Python and just starting with Java. 🙂

I think I understand it, will do a test flow and try it out.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 9, 2022, 7:18am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/27 "2022-11-09T07:18:24Z")

</div>

Hi Arie!  
In the Read-JSON card, isn’t all path’s optional?  
In my flow I only check the path “Yes/No 1” but get an error for “Text 1” path.  
In the first Read-card I get error “Invalid type for token ‘text1’ expected ‘string’ but got ‘undefined’”.

```auto
[tef:FLOWS:"H4sIAAAAAAACA7VWbW/bNhD+KwE/mwEpvojUtwJdtxZrMyAb+sEJDL6cbC2y5Mly0yzNf9/RshYHcQptaOAPFskj77l7nuPxnnw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vDK8LYS2iY8p1BIsYH+n0YmcovvUKaygPvholJWBs/2T7ourd/gWIvdXL9bnFSlKV29hdvWsJo+WTtbh0fqT2juaP663o+lDjR3NpLoahw+YjNDW6aYld1DX7S1OHHVMntRwW8V+RYpmV9czsoJquerHUcpq0/aQHp2TOumBzkM9qB9dD/N5cF2c+qKA1GMOz4lJb7tDNZtX0uKIflqPOEY/qUkeci/GSzJ7JfhTOv8x/IeH64d/AAUx6yFBDQAA":/tef]

```

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 9, 2022, 7:35am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/28 "2022-11-09T07:35:39Z")

</div>

Hey @Anders_Gregow ,

Please also add the value of your ArduinoDisplayStates?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 9, 2022, 7:40am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/29 "2022-11-09T07:40:48Z")

</div>

> [@Anders\_Gregow](#):
>
> In the Read-JSON card, isn’t all path’s optional?

Yes, that should be yeah.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 9, 2022, 7:52am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/30 "2022-11-09T07:52:33Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Yes, that should be yeah.

Okay, something is seriously wrong with one of the latest updates from Homey or the Web App.  
Non-enterered arguments do not get cleared anymore, just become an empty string.  
I have been getting errors because if this in multiple apps without updating any of them.

Awell, i did solve it on my end in the JSON Handler. Update to 1.2.4 (Test) and it should work.

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 9, 2022, 7:57am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/31 "2022-11-09T07:57:53Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Please also add the value of your ArduinoDisplayStates?

It is in the comment card: {“ArmingWithDoorWindowOpen”:false,“MaindoorUnlocked”:false,“FreezerFridgeDoorOpen”:false,“PorchDoorOpen”:false,“ImportantMsg”:false,“NewMail”:false,“Test”:false}

> [@Arie\_J\_Godschalk](#):
>
> Awell, i did solve it on my end in the JSON Handler. Update to 1.2.4 (Test) and it should work.

Nice!  
Did you do a workaround for a Homey bug or has Athom changed some API?

---

<div class="post-metadata">

**Author:** ![Anders\_Gregow](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anders_gregow/32/61721_2.png) [@Anders\_Gregow](https://community.homey.app/u/Anders_Gregow)\
**Post date:** [November 9, 2022, 8:01am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/32 "2022-11-09T08:01:27Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Awell, i did solve it on my end in the JSON Handler. Update to 1.2.4 (Test) and it should work.

Works great, thanks for the fix.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 9, 2022, 8:01am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/33 "2022-11-09T08:01:52Z")

</div>

> [@Anders\_Gregow](#):
>
> Did you do a workaround for a Homey bug or has Athom changed some API?

Don’t know what the bug is or why, i just ignore paths with empty strings.

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [December 8, 2022, 9:35am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/34 "2022-12-08T09:35:33Z")

</div>

@Arie_J_Godschalk @Peter_Kawa

Are you planning to buy the new Homey Pro 2023? And if yes, how are you planning to handle incoming JSON objects? The reason I ask is because I now use the HTTP Request Flowcards app, but that hasn’t been updated for some time and isn’t compatible with the new Homey.

Hope to hear from you.

Dennis

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [December 8, 2022, 1:39pm UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/35 "2022-12-08T13:39:56Z")

</div>

Hey dennis,

Yeah, i already preordered the early 2023.  
I dont use the request app, so i am not sure what are all the options.  
But, sure, if the other app is not planned to be migrated, i can add some request handle cards.

Please create a feature ticket at bitbucket with some good description, images and/or examples.

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [December 9, 2022, 11:09am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/36 "2022-12-09T11:09:02Z")

</div>

Hi @Arie_J_Godschalk

Bitbucket? Never heard of that before. Probably because your are programmer and I’m a user and learning.

I created an account at Bitbucket and got to your page. But how do I create a feature request specifically for your Json app?

 ![Screenshot_20221209-120807_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/3/23999d0284cc4c0b17d9b206f790f8ba1846c604.jpeg)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [December 9, 2022, 11:31am UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/37 "2022-12-09T11:31:20Z")

</div>

Haha, sorry about that m8.  
I’ll update my topics to include the respective “Report a problem” link from the app store.

All my apps have a “Report an issue/problem” link at the app store  
[JSON Handler App voor Homey | Homey](https://homey.app/a/nl.qluster-it.JsonHandler/) linked to the issue site on bitbucket for the specific app.

And there ( [QlusterIT / nl.qluster-it.JsonHandler / issues — Bitbucket](https://bitbucket.org/QlusterIT/nl.qluster-it.jsonhandler/issues)) you can click on Create Issue (right-top side).  
You don’t actually need to create a BitBucket account for it.  
All my apps support tickets are publicly open and Anonymous users can create issues.

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [December 9, 2022, 12:45pm UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/38 "2022-12-09T12:45:11Z")

</div>

Aah ok @Arie_J_Godschalk

Thanks. Will find it now!

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [December 10, 2022, 12:21pm UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/39 "2022-12-10T12:21:41Z")

</div>

Hi @Arie_J_Godschalk

I created a feature request on Bitbucket.

---

<div class="post-metadata">

**Author:** ![Hamster](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hamster/32/16580_2.png) [@Hamster](https://community.homey.app/u/Hamster)\
**Post date:** [December 19, 2022, 3:10pm UTC](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317/40 "2022-12-19T15:10:11Z")

</div>

Hi @Arie_J_Godschalk,

I am trying to do something very simple, but I can’t get this to work. Maybe you can point me in the right direction?

I have this Advanced Flow:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/b/6b8f41b395146ef126431a545b93acc409385277.png)

But as you can see, I get an error “Unexpect token u in JSON at position 0”.

I am using this source:  
[https://json.tvgids.nl/v4/programs/?day=0](https://json.tvgids.nl/v4/programs/?day=0)

Which seems like a valid JSON file, because both [https://jsonpath.com/](https://jsonpath.com/) and [https://jsonpathfinder.com/](https://jsonpathfinder.com/) are giving me correct results.

The flow should give me the name of the first TV program on the first channel.

Where’s my mistake?

[Previous page](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317.md?page=1)

[Next page](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317.md?page=3)
