RTE on Parsing a Json and calling if a bool value is true

Might help to show some example data...

sure, the json file has entries looking like this, (I have taken the first 2 nodes from the file)
{
"-ONepJ5Mtf-lHQZyNk6I": {
"accelX": 0,
"accelY": 0,
"accelZ": 0,
"crashDetected": false,
"gyroX": 0,
"gyroY": 0,
"gyroZ": 0,
"latitude": 17,
"longitude": 62,
"temperature": 36.5,
"timestamp": "2025-04-12 21:58:59",
"vibration1": 0,
"vibration2": 0
},
"-ONepNEi-70Yg9wEi0NJ": {
"accelX": 0,
"accelY": 0,
"accelZ": 0,
"crashDetected": false,
"gyroX": 0,
"gyroY": 0,
"gyroZ": 0,
"latitude": 17,
"longitude": 62,
"temperature": 36.5,
"timestamp": "2025-04-12 21:59:16",
"vibration1": 0,
"vibration2": 0
},

What is the runtime error?

This works:

json:

{
"-ONepJ5Mtf-lHQZyNk6I": {
"accelX": 0,
"accelY": 0,
"accelZ": 0,
"crashDetected": false,
"gyroX": 0,
"gyroY": 0,
"gyroZ": 0,
"latitude": 17,
"longitude": 62,
"temperature": 36.5,
"timestamp": "2025-04-12 21:58:59",
"vibration1": 0,
"vibration2": 0
},
"-ONepNEi-70Yg9wEi0NJ": {
"accelX": 0,
"accelY": 0,
"accelZ": 0,
"crashDetected": false,
"gyroX": 0,
"gyroY": 0,
"gyroZ": 0,
"latitude": 17,
"longitude": 62,
"temperature": 36.5,
"timestamp": "2025-04-12 21:59:16",
"vibration1": 0,
"vibration2": 0
}
}

It may help to confirm that you are indeed getting a dictionary:

The app doesn't display, it just shows RunTime Error
Is there a way to find out?

Show what you see

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

.

Just to let you all know, I made a few changes to it and now it says the following
But there is stuff in the link I can see from my browser

MotoMate.aia (4.1 KB)

Your URL is lacking a http:// prefix.

Even after adding one, I get an 1109 error, meaning there's nothing there.

Where did you get that URL from?

It is a database I have created for my project and it does open to a json file

So I added an https to the link and downloaded it again but now it does nothing, after some more checking I inferred it probably does not receive the text required from the web, could I be doing it wrong?

image

I turned off SaveResponse in your Web1 component, since you are only doing Get Text.

Also, you change keys in the JSON when a crash occurs.

So you should be looking for key crash

Further work is needed to not spam the phone calls.


MotoMate (1).aia (4.1 KB)

By the Way, I am not sure you will find the latest reading in the key at the end of the list of keys.

Those hash keys look pretty random.

The internal timestamp gives better assurance.

THANK YOU SO MUCH, it worked
Yeah I know I have not implemented the processedNodes part.
I had another doubt, currently the issue I am facing is that the call is only going if I am running the app, is there a way to have the call happen itself (when crash is detected) without having to open the app. (For example a way to have the always run in the background)

That's above my pay grade.

Here's code to grab the latest, by time stamp, and call just once.


MotoMate (3).aia (4.6 KB)

yes you can
you will need the itoo extension

read the complete thread to find several examples

Taifun

Wouldn't changing the AndroidManifest file to allow Foreground Services work?

This is one of the things, itoo is doing for you
The other thing is the background functionality itself
Taifun