# Another difficult JSON question

**URL:** <https://community.thunkable.com/t/another-difficult-json-question/2959987>\
**Category:** Issues / Bugs\
**Created:** [April 21, 2024, 11:54am UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987 "2024-04-21T11:54:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [April 21, 2024, 11:54am UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/1 "2024-04-21T11:54:01Z")

</div>

I am sure i need to try. list format as i am having an Array to handle.  
My Problem is that i dont know how many records the result is producting when i do the request  
i only want the “ID” and “Name” from the records added into a list and using “For Each” in Thunkable.

Here is the result i get:

```auto
array [5]
	0 {7}
id	:	102
gid	:	9091001000000102
name	:	Styrsvik
note	:	Runmarö
lat	:	59.2802666088178
lon	:	18.7313783519481
	valid {1}
from	:	2012-06-23T00:00:00
	1 {7}
id	:	103
gid	:	9091001000000104
name	:	Nämdöböte
note	:	Nämdö
lat	:	59.2088268465829
lon	:	18.7399218125326
	valid {1}
from	:	2012-06-23T00:00:00
	2 {7}
id	:	104
gid	:	9091001000000104
name	:	Aspö
note	:	vid Nämdö
lat	:	59.2157454470392
lon	:	18.753322503205
	valid {1}
from	:	2021-02-24T00:00:00
	3 {6}
id	:	105
gid	:	9091001000000104
name	:	Idöborg
lat	:	59.2042855337483
lon	:	18.7576059070945
	valid {1}
from	:	2012-06-23T00:00:00
	4 {7}
id	:	106
gid	:	9091001000000106
name	:	Östanvik
note	:	Nämdö
lat	:	59.1973533499037
lon	:	18.7400578888828
	valid {1}
from	:	2012-06-23T00:00:00

```

and here is the input

```auto
[
 {
   "id": 102,
   "gid": 9091001000000102,
   "name": "Styrsvik",
   "note": "Runmarö",
   "lat": 59.2802666088178,
   "lon": 18.7313783519481,
   "valid": {
     "from": "2012-06-23T00:00:00"
   }
 },
 {
   "id": 103,
   "gid": 9091001000000103,
   "name": "Nämdöböte",
   "note": "Nämdö",
   "lat": 59.2088268465829,
   "lon": 18.7399218125326,
   "valid": {
     "from": "2012-06-23T00:00:00"
   }
 },
 {
   "id": 104,
   "gid": 9091001000000104,
   "name": "Aspö",
   "note": "vid Nämdö",
   "lat": 59.2157454470392,
   "lon": 18.7533225032050,
   "valid": {
     "from": "2021-02-24T00:00:00"
   }
 },
 {
   "id": 105,
   "gid": 9091001000000105,
   "name": "Idöborg",
   "lat": 59.2042855337483,
   "lon": 18.7576059070945,
   "valid": {
     "from": "2012-06-23T00:00:00"
   }
 },
 {
   "id": 106,
   "gid": 9091001000000106,
   "name": "Östanvik",
   "note": "Nämdö",
   "lat": 59.1973533499037,
   "lon": 18.7400578888828,
   "valid": {
     "from": "2012-06-23T00:00:00"
   }
  }
 ]

```

Any ideas someone ?  
Appreciate just a guidance…

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 22, 2024, 6:03pm UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/2 "2024-04-22T18:03:23Z")

</div>

That result is not JSON. Can you post the full JSON response as text?

---

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [April 22, 2024, 7:16pm UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/3 "2024-04-22T19:16:44Z")

</div>

Iam afraid i cant. I have no way to catch the result. Its too big so i cant just copy paste it… any other idea

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 22, 2024, 8:20pm UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/4 "2024-04-22T20:20:43Z")

</div>

I usually assign the green `response` block to a text input’s text and then I’m able to copy the response when previewing the app.

I asked ChatGPT 4 “Based on the data provided, what is the likely JSON structure for this API response?” Here’s what it said:

```auto
[
    {
        "id": 102,
        "gid": "9091001000000102",
        "name": "Styrsvik",
        "note": "Runmarö",
        "lat": 59.2802666088178,
        "lon": 18.7313783519481,
        "valid": {
            "from": "2012-06-23T00:00:00"
        }
    },
    {
        "id": 103,
        "gid": "9091001000000104",
        "name": "Nämdöböte",
        "note": "Nämdö",
        "lat": 59.2088268465829,
        "lon": 18.7399218125326,
        "valid": {
            "from": "2012-06-23T00:00:00"
        }
    },
    {
        "id": 104,
        "gid": "9091001000000104",
        "name": "Aspö",
        "note": "vid Nämdö",
        "lat": 59.2157454470392,
        "lon": 18.753322503205,
        "valid": {
            "from": "2021-02-24T00:00:00"
        }
    },
    {
        "id": 105,
        "gid": "9091001000000104",
        "name": "Idöborg",
        "lat": 59.2042855337483,
        "lon": 18.7576059070945,
        "valid": {
            "from": "2012-06-23T00:00:00"
        }
    },
    {
        "id": 106,
        "gid": "9091001000000106",
        "name": "Östanvik",
        "note": "Nämdö",
        "lat": 59.1973533499037,
        "lon": 18.7400578888828,
        "valid": {
            "from": "2012-06-23T00:00:00"
        }
    }
]

```

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 22, 2024, 8:28pm UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/5 "2024-04-22T20:28:02Z")

</div>

To get a list of “id” property values, use this code (from the first screen of the project [here](https://x.thunkable.com/copy/883adb51b3c283ea4251b29dec7d01b5)):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/98d3106c19f2617d0ab3b50f613010ffc1458e8e.png)

With this result:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/7/770e249f91508e7b6101bd9e86915d1ef74cb944.png)

---

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [April 23, 2024, 6:09am UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/6 "2024-04-23T06:09:11Z")

</div>

Thank you - I normally do the same just to Copy paste and then investigate. But the response is so big i cant copy it… the phone wonte let me. And cant run it in a web version either because of CORS probs.  
I guess this list will be 10-15000 items long…  
Still i’ll try your example and see how goes…  
Thanks for your ideas @tatiang … 😃

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 23, 2024, 4:35pm UTC](https://community.thunkable.com/t/another-difficult-json-question/2959987/7 "2024-04-23T16:35:08Z")

</div>

Will the API let you filter the data in order to retrieve a smaller response? For example, Airtable can do this.
