Need JSON/Web API Help

So, I have a script on my server that generates a .json file. The contents of that file are output like this:


I then have the following blocks:

I want the text set for each of the values returned. However, when I call the API and access these variables, my text is set to null. I am not sure what I am missing here and why my .json file is not returning anything. Is there something special I need to do? This is a static .json file that is updated dynamically by a PHP script. So, any time the PHP script is called, it updates the .json file with current data. I should then be able to pull this static .json file into the app using the Web API component. I’m not sure where I’m going wrong on this. Can anyone see what’s causing this to return null?


This is how you should do it


Hi! Try this -

The JSON response you are is an array, as it has [ ] in it. You need to access the first element of the array from the object first, then add the property name. Let me know if this works :+1:

Edit: @muneer I missed you reply :sweat_smile: @amazingwx both of our replies are based on the same approach btw.


@kartik14 I tried this:


As soon as the web app loads, it immediately flashes to a blank white screen…

1 Like

It’s gotta be a problem with my JSON. I just tested another reputable JSON source with your solutions and it works. I’ll work it out on my script.

Thanks for the assistance!


The preferable approach is to do it this way

You are here handing most conditions that you expect your users could come across which are:

  • There is a technical error preventing the execution of the API call
  • The API call resulted in a data retrieval problem

This should prevent the blank screen issue.


I would have arrived of some semblance of that eventually, because I wouldn’t want a user to think it’s broken. I typically throw “N/A” text in just so they see something and know the data is not there.

And, I did discover it was a problem with my script. No idea why, since I encoded the text as JSON. However, I discovered that the static file needed to be decoded and then encoded as JSON again. Once I did that, it worked like a charm!


Glad to hear that it’s solved now. :blush: Happy Thunking!