# If/Do/Else doesn't work

**URL:** <https://community.thunkable.com/t/if-do-else-doesnt-work/2946995>\
**Category:** Questions about Thunkable X\
**Created:** [April 15, 2024, 10:54am UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995 "2024-04-15T10:54:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr.dols93nwe](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@mr.dols93nwe](https://community.thunkable.com/u/mr.dols93nwe)\
**Post date:** [April 15, 2024, 10:54am UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995/1 "2024-04-15T10:54:01Z")

</div>

I have the following chart, but it doesn’t work, returning null all over.

Please help me make it work

 ![Untitled](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/3/83a57b9dc4ed4ffc0628ebcdf6521d7e265fb588.png)

---

<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 15, 2024, 8:39pm UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995/2 "2024-04-15T20:39:16Z")

</div>

That is really complex for someone to try and troubleshoot by just looking at the screenshot. The screenshot is helpful but you’ll need to post the **full JSON response as text** in order for someone to check that against the blocks you are using.

Make sure to format the JSON using the \</\> button in the forums toolbar above your post.

---

<div class="post-metadata">

**Author:** ![mr.dols93nwe](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@mr.dols93nwe](https://community.thunkable.com/u/mr.dols93nwe)\
**Post date:** [April 16, 2024, 3:33am UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995/3 "2024-04-16T03:33:22Z")

</div>

My JSON

```auto
{
    "documentation": "https://opencagedata.com/api",
    "licenses": [
        {
            "name": "see attribution guide",
            "url": "https://opencagedata.com/credits"
        }
    ],
    "rate": {
        "limit": 2500,
        "remaining": 2485,
        "reset": 1713312000
    },
    "results": [
        {
            "annotations": {
                "DMS": {
                    "lat": "13° 6' 53.16840'' N",
                    "lng": "109° 18' 19.03644'' E"
                },
                "MGRS": "49PCQ1628350444",
                "Maidenhead": "OK43pc67pn",
                "Mercator": {
                    "x": 12167808.99,
                    "y": 1463158.086
                },
                "OSM": {
                    "edit_url": "https://www.openstreetmap.org/edit?way=1042164566#map=17/13.11477/109.30529",
                    "note_url": "https://www.openstreetmap.org/note/new#map=17/13.11477/109.30529&layers=N",
                    "url": "https://www.openstreetmap.org/?mlat=13.11477&mlon=109.30529#map=17/13.11477/109.30529"
                },
                "UN_M49": {
                    "regions": {
                        "ASIA": "142",
                        "SOUTHEAST_ASIA": "035",
                        "VN": "704",
                        "WORLD": "001"
                    },
                    "statistical_groupings": [
                        "LEDC"
                    ]
                },
                "callingcode": 84,
                "currency": {
                    "alternate_symbols": [],
                    "decimal_mark": ",",
                    "format": "%n %u",
                    "html_entity": "&#x20AB;",
                    "iso_code": "VND",
                    "iso_numeric": "704",
                    "name": "Vietnamese Đồng",
                    "smallest_denomination": 100,
                    "subunit": "Hào",
                    "subunit_to_unit": 1,
                    "symbol": "₫",
                    "symbol_first": 0,
                    "thousands_separator": "."
                },
                "flag": "🇻🇳",
                "geohash": "w6mdx73xjf4h25cz6vwc",
                "qibla": 287.9,
                "roadinfo": {
                    "drive_on": "right",
                    "road": "Nguyễn Hữu Thọ",
                    "road_type": "tertiary",
                    "speed_in": "km/h"
                },
                "sun": {
                    "rise": {
                        "apparent": 1713306660,
                        "astronomical": 1713302340,
                        "civil": 1713305340,
                        "nautical": 1713303840
                    },
                    "set": {
                        "apparent": 1713264900,
                        "astronomical": 1713269220,
                        "civil": 1713266160,
                        "nautical": 1713267660
                    }
                },
                "timezone": {
                    "name": "Asia/Ho_Chi_Minh",
                    "now_in_dst": 0,
                    "offset_sec": 25200,
                    "offset_string": "+0700",
                    "short_name": "+07"
                },
                "what3words": {
                    "words": "xelửa.ýnghĩa.cảitrắng"
                }
            },
            "bounds": {
                "northeast": {
                    "lat": 13.115959,
                    "lng": 109.3069427
                },
                "southwest": {
                    "lat": 13.114769,
                    "lng": 109.3052879
                }
            },
            "components": {
                "ISO_3166-1_alpha-2": "VN",
                "ISO_3166-1_alpha-3": "VNM",
                "ISO_3166-2": [
                    "VN-32"
                ],
                "_category": "road",
                "_normalized_city": "Thành phố Tuy Hòa",
                "_type": "road",
                "city": "Thành phố Tuy Hòa",
                "continent": "Asia",
                "country": "Việt Nam",
                "country_code": "vn",
                "road": "Nguyễn Hữu Thọ",
                "road_type": "tertiary",
                "state": "Tỉnh Phú Yên"
            },
            "confidence": 9,
            "distance_from_q": {
                "meters": 7
            },
            "formatted": "Nguyễn Hữu Thọ, Thành phố Tuy Hòa, Tỉnh Phú Yên, Việt Nam",
            "geometry": {
                "lat": 13.114769,
                "lng": 109.3052879
            }
        }
    ],
    "status": {
        "code": 200,
        "message": "OK"
    },
    "stay_informed": {
        "blog": "https://blog.opencagedata.com",
        "mastodon": "https://en.osm.town/@opencage"
    },
    "thanks": "For using an OpenCage API",
    "timestamp": {
        "created_http": "Tue, 16 Apr 2024 03:25:04 GMT",
        "created_unix": 1713237904
    },
    "total_results": 1
}

```

---

<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 16, 2024, 4:00am UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995/4 "2024-04-16T04:00:58Z")

</div>

The blocks you’re using are getting a text string value and then converting an object to JSON even though it’s not an object at that point and you don’t need JSON.

Please try this for the “lat” property that you’re retrieving for Long1’s Text:

Set Long1’s Text to get property “results[1].geometry.lat” of `get object from JSON [response]`

That’s shorthand for all of these blocks:

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

Let me know if that works. If not, please post a screenshot of the modified blocks. Focus on getting that one set of blocks correct and you should be good for working on the next sets.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [July 15, 2024, 4:01am UTC](https://community.thunkable.com/t/if-do-else-doesnt-work/2946995/5 "2024-07-15T04:01:14Z")

</div>

Closed on July 15, 2024, 4:01am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
