[APP][Pro] JSON Handler and Manipulator

Also having this issue - may be to do with the JSON needing parsing, but I’m not sure and can’t get the Parse JSON card to work at all. :frowning:

Hey, could you share the json it parses?

1 Like

Please share the json and flow?

1 Like

The source is in my post. It’s a very large json :slight_smile:

I managed to resolve, thanks Arie

Well, first of all, you do not need to use the $ symbol, since the json is the starting point.

But, it will still not work, i think the jsonfile is to big for the Logic HTTP Get?
Because, i cannot place the answer/value in a variable or a BetterLogic variable.

The left side of my picture doesn’t work at all!

However, when you use the right app side, it does work.

Also, this works fine:

Meaning: It’s a “bug” in the default Logic Http Get card.

1 Like

Hi,

I need some help, don’t know if this is possible.
I do an http request to a server, this server answers with the following response:
{“result”:“false”,“msg”:“TV poort reageert niet”}

Is it possible to use this app to convert this string into tags?
So i use the "lees json’’ card, in the ‘bestaande json’ i put the answer tag of the http request card which contains this string.
Then i am not sure what to fill in to get the response into tag cards…
I just need actually 2 cards: result and msg

Any advise?

Sure, use the 3xRead flowcard.
Use the json as input.
In the first text1-field enter result.
In the text2 field, enter msg.

Now 2 (of the 3) text tokens will be filled with the values.

thx got it working!

1 Like

I have changed the way paths work (everythink will keep working).
It now uses the npm jsonpath library:

The $. is added automaticly when you do not, so you can still query directly by calling it’s property like text, no need to write $.text.

This will allow for:
image

Here, a json with an array of flows returned from the DC app.
The JSON handler app searches for the first flow with a name that starts with ‘Con’ and returns it’s name.

I have been using JQ on linux for a number of years and I want to convert some of these scripts to my homey. I am running into syntax issues… and this one I can’t figure it out;

.parcellifecycleResponse.parcelLifeCycleData.scanInfo.scan | .[-1] | .scanData.location

I am sure I am missing something simple here… but what am I doing wrong? The statement works in JQ and it would return me the location of my DPD parcel.

JSONPath != jq

yeah I know… doesn’t help me unfortunately…

Please share the json so i can gove you the path for it :wink:

This is the Json;
https://tracking.dpd.de/rest/plc/en_NL/23715012122295

I kind of got it to work with the regular logic cards but I think your app would be more suited for it!

First of, removing the leading dots.
Try this?

parcellifecycleResponse.parcelLifeCycleData.scanInfo.scan[0]

It throws me;

Invalid token type: text1. Expected: String

parcellifecycleResponse.parcelLifeCycleData.scanInfo.scan[0].scanData.location
and
parcellifecycleResponse.parcelLifeCycleData.scanInfo.scan[0].scanData.name

This works for me.

Yes this works for me as well now. I made a minor change to get the latest status (this wasn’t in the original example);

parcellifecycleResponse.parcelLifeCycleData.scanInfo.scan[-1:].scanData.location

What confused me a little is that with the regular logic cards the output can be still json (like the whole array)… I noticed with your json handler it’s the actual field that needs to be the output (at least it seems that way).