Yes @domhnallohanlon this gave me a response on my browser. I put it into jsonformatter-online.com and then coded my JSON. Sure @muneer, I’ll send my response text as soon as I get on my laptop. I’m currently on my tablet.
When troubleshooting an API call, I would want to know this:
Can you get a valid JSON response by pasting the full API url into a browser?
If so, post the full url here (removing the API key first).
If so, post the full JSON response here (hiding any private/confidential data).
The next step would be to see your blocks, which you’ve posted above, and see if the property values match the JSON structure. If they don’t, or if you have any spelling/case errors, you’ll get a white screen which is now replaced by the “Something has gone wrong” message you saw.
Your blocks look correct to me for that JSON response. Are you just assigning a label’s text value to “app variable ocr text” or is there more going on than that?
Are you saying it still doesn’t work for you? Do you want to send me the link to your project? I can use my own API key to see if it works with your code. You’ll have to let me know which screen it’s on, etc.
I can send you via PM. Earlier, I was using camera to allow users to take their own pictures, but now I’m trying to replace it with an image from the net.
I’ve sent you the link. Even after I’ve replaced the Image URL with something from Google I still get an error. Edit: It’s working after I removed the Camera and Media DB code. I think it had something to do with that. I got the correct text in my input after removing those.
Okay because when I checked it, I just needed to connect the “app variable ocr text” to the label block. You must have fixed it before I accessed your link.
Sorry for the late reply. I’ll share the new link via PMs, but I think that unconnected blocks are automatically deleted when shared. Regardless, I’ll share the link.
When I preview those blocks in Thunkable Live, I see this:
STEP 1
STEP 2
STEP 3
STEP 4
[crash]
So it never gets to STEP 5 which means that the problem occurs right before that:
But it’s unlikely that text input assignment is actually causing the problem so I’m thinking it’s actually the JSON parsing. But why? That I don’t know yet.
I do know that if there’s no value in the ParsedText property of the JSON response, the app will crash.
It’s worth removing the variable ocr text and just add your own simple text and see if it will still crash. As you said this is unlikely but let’s not keep a single stone unturned.