How to parse this json

Thank you soo much

2 Likes

For multiple data which block should use?

You’re going to need to explain.

I mean how to retrive from an josn list with index
Like that.in that json there was two list item.so how can i retrive data from specific index
{
“id”: 9,
“name”: “Clothing”,
“slug”: “clothing”,
“parent”: 0,
“description”: “”,
“display”: “default”,
“image”: {
“id”: 730,
“date_created”: “2017-03-23T00:01:07”,
“date_created_gmt”: “2017-03-23T03:01:07”,
“date_modified”: “2017-03-23T00:01:07”,
“date_modified_gmt”: “2017-03-23T03:01:07”,
“src”: “https://example.com/wp-content/uploads/2017/03/T_2_front.jpg”,
“name”: “”,
“alt”: “”
},
{
“id”: 10,
“name”: “another”,
“slug”: “clothing”,
“parent”: 0,
“description”: “”,
“display”: “default”,
“image”: {
“id”: 730,
“date_created”: “2017-03-23T00:01:07”,
“date_created_gmt”: “2017-03-23T03:01:07”,
“date_modified”: “2017-03-23T00:01:07”,
“date_modified_gmt”: “2017-03-23T03:01:07”,
“src”: “https://example.com/wp-content/uploads/2017/03/T_2_front.jpg”,
“name”: “”,
“alt”: “”
},

Use the OpenObjectInArrayByIndex function!

1 Like

How to use that block.where to enter attribute name & json object name.can you tell me

Are you using an extension to work with Json? Please read about dictionaries …

If they’re getting data through an API, dictionaries are not going to help unless they use an extension to convert it.

My API returns Json from PHP Scripts and use Kodular’s blocks (without extension)…

Interesting, because I get an error saying it’s not a dictionary last time I tried… Maybe I’m remembering something else.

1 Like

http://ai2.appinventor.mit.edu/reference/other/json-web-apis.html

Dictionary is little bit complex to me comparison to json tools extension to parse json.

Friend, you are not reading my answers … look at the latest … web.json + dictionary examples.

I read this.there not given how to read subjson object.& i already create my app with json tools extension.that’s why i didn’t trying dictionary right now

1 Like

I too getting this


IMG_20201231_212905
Response content:

    [
   {
      "id":"1",
      "app_name":"ez-learn",
      "version_code":"1",
      "version_name":"1.0",
      "change_log":"No log",
      "app_link":"https:\/\/mysite.com",
      "ads":"1"
   }
]

I tried your method but geeting error

Is not a well-formed list of pairs

That’s because there are no such things as keys in arrays. Use the for each item in list block or select a specific item from the list.

Sorry ,
This block above is from the answer I suggested above. These blocks are Peter’s.

Before the dictionary blocks existed, I used this: