JSON: LoadJSON vs LoadAsyncJSON - Forum

Forum Navigation
You need to log in to create posts and topics.

JSON: LoadJSON vs LoadAsyncJSON

Ok I need to access data online and my source is JSON. I was informed that LoadJSON is a bit deprecated and to use LoadAsyncJSON instead. However, there is no entry in the Help describing how to use this action. It seems they are two totally different actions. LoadJSON allows me a variable. LoadAsyncJSON directs me to use a subroutine. How do I get data out of the JSON data from here?
There are no samples to follow.

Advice?

@pauljonestindall please take a look at the attached app.

Within the button:

LoadAsyncJSON "https://reqres.in/api/users/2" "parseData"

parseData is a subroutine with just one parameter [data]

In the subroutine (it is important to add a parameter from the bottom right corner in Project > Subroutines):

Consolelog [data]

Thats all! Now you are sure the data is ready.

Uploaded files:
  • You need to login to have access to uploads.

@luishp

I know I've really bugged you today but I really appreciate your help...

I see the data from my JSON source in the console now. I get a [{...}] type of thing. There is no obvious object name. I'm not sure how to parse it to get the specific data I need to a variable. How do I get length: or name: into a variable?

Uploaded files:
  • You need to login to have access to uploads.

@pauljonestindall don't worry. Please download the attached sample app.
You probably would like to take a look at the database videotutorials. Note that data loaded from database is in JSON format too.

Regards.

Uploaded files:
  • You need to login to have access to uploads.
José María Torres has reacted to this post.
José María Torres

@luishp

I have it working. Thank you very much for your help. Now on to PDFs.

luishp has reacted to this post.
luishp