# Null values returned by Google Distance matrix

**URL:** <https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886>\
**Category:** Questions about Thunkable X\
**Tags:** googlemaps\
**Created:** [September 9, 2020, 5:30pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886 "2020-09-09T17:30:12Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 11, 2020, 6:46pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/21 "2020-09-11T18:46:45Z")

</div>

The string I am using for testing currently is  
[https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=51,0&destinations=52,0&key=AIzaSyAYiancwAdNBHcw7Ho7S1o2Xt\_OM0WM44k](https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=51,0&destinations=52,0&key=AIzaSyAYiancwAdNBHcw7Ho7S1o2Xt_OM0WM44k)

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 11, 2020, 7:19pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/22 "2020-09-11T19:19:23Z")

</div>

This is all a bit frustrating. I have used these same blocks in another app without an issue. YEsterday the app was going into a white screen cras as soon as I made the api call but today at least I can see an error message being returned. I would really appreciate all the feedback and insight you can supply.

Many thanks to you all for looking into this.

---

<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:** [September 11, 2020, 10:10pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/23 "2020-09-11T22:10:24Z")

</div>

> [@rwplummer1yf4f](#):
>
> “The website or service provider you are trying to reach does not support HTTPS requests.—”

I’ve seen that message and it usually isn’t an accurate description of the problem. I think that gets sent when an API call either doesn’t contain the correct parameters or when something else happens like being over quota (I made an app that worked perfectly, shared it with my colleagues at work and then quickly went over the API’s stated quota… oops!).

---

<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:** [September 11, 2020, 10:13pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/24 "2020-09-11T22:13:23Z")

</div>

Unless you’ve change it since you posted the link to postcodes ([https://x.thunkable.com/projects/5f553e7941fe930bd6970783/5688ede2-4094-4685-8a0a-a375b3b98451/designer](https://x.thunkable.com/projects/5f553e7941fe930bd6970783/5688ede2-4094-4685-8a0a-a375b3b98451/designer)), you aren’t checking for the status… you’re only checking for the error block.

If you share a project link and then make any changes to the project, the link only points to the original/old content. So you have to then share another project link. Kind of a pain.

---

<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:** [September 11, 2020, 10:18pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/25 "2020-09-11T22:18:15Z")

</div>

> [@rwplummer1yf4f](#):
>
> If I post the request into chrome, I get a result. If I preview in IOS it works but android seems to be a no go.

I may not be much help here. I only develop on Mac and test on iPhone. Sorry!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 12, 2020, 5:56am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/26 "2020-09-12T05:56:36Z")

</div>

Chech it

[https://x.thunkable.com/projects/5f5c627733142a64f7cb93ed/project/properties/designer/](https://x.thunkable.com/projects/5f5c627733142a64f7cb93ed/project/properties/designer/)

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 9:40am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/27 "2020-09-12T09:40:04Z")

</div>

all input is welcome sir 🙂

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 9:42am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/28 "2020-09-12T09:42:00Z")

</div>

New link to the problem app is here where the report of the error and the blank status is returned.  
[https://x.thunkable.com/projects/5f59e6096f239bf97b8157da/5688ede2-4094-4685-8a0a-a375b3b98451/blocks](https://x.thunkable.com/projects/5f59e6096f239bf97b8157da/5688ede2-4094-4685-8a0a-a375b3b98451/blocks)

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 9:49am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/29 "2020-09-12T09:49:14Z")

</div>

Doesnt work! No distance result is shown in LabelResults.From my tests it seems the request is refused due to the https error mentioned above so we dont get a status return at all so your code never fires.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 12, 2020, 10:52am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/30 "2020-09-12T10:52:03Z")

</div>

@rwplummer1yf4f This example works well on my device.

 ![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/d/cd2686e21981b5bc82bd99d8105ec0dffe069fec.png)

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 11:09am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/31 "2020-09-12T11:09:22Z")

</div>

Interesting. It Doesnt work in live test as the response I get is The website or service provider you are trying to reach does not support HTTPS requests.—

The blocks join the error message, then — and then the return status and the returned status is blank so error trapping doesnt work and no value is returned. Does this point to an issue with the WEBAPI calls within thunkable that it works on external devices but not with the live preview tool provided by Thunkable?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 12, 2020, 11:11am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/32 "2020-09-12T11:11:40Z")

</div>

I only use Live Preview to check if the app is working at all. I do all the other debugging either on emulators or on devices, and for this reason I don’t have many problem

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 11:26am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/33 "2020-09-12T11:26:05Z")

</div>

So we are just accepting it doesnt work with the thunkable live or web preview. That’s not the support I was hoping for tbh. Should I raise this further as it appears to be a bug. Tatiang, Can you give me a link to any distancematrix support groups you may know of please and i’ll take it up with them.

THanks

---

<div class="post-metadata">

**Author:** ![rwplummer1yf4f](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@rwplummer1yf4f](https://community.thunkable.com/u/rwplummer1yf4f)\
**Post date:** [September 12, 2020, 12:47pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/34 "2020-09-12T12:47:13Z")

</div>

Dont know if you saw my response below. Do you know of any distancematrix forums I could go to for help?

---

<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:** [September 12, 2020, 8:10pm UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/35 "2020-09-12T20:10:22Z")

</div>

> [@rwplummer1yf4f](#):
>
> That’s not the support I was hoping for tbh. Should I raise this further as it appears to be a bug. Tatiang, Can you give me a link to any distancematrix support groups you may know of please and i’ll take it up with them.

I’m not sure if you’re directing your comment at us or at Thunkable Staff but just to be clear, I’m a customer. I don’t have any affiliation with Thunkable beyond that.

I don’t know of any forums. There may be some. I just recently learned about the distance matrix API myself. As I looked into it, I decided I preferred to use the haversine formula for calculating distance. So I added that to my project and it seems to be working pretty well. It was several hours of work but this was really helpful: [Calculate distance travelled - #15 by tatiang](http://community.thunkable.com/t/calculate-distance-travelled/565278/15)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [September 13, 2020, 12:12am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/36 "2020-09-13T00:12:41Z")

</div>

Have you tried using sheets to do the math? You should be able to calculate distances using sheets, right?

---

<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:** [September 13, 2020, 5:56am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/37 "2020-09-13T05:56:43Z")

</div>

@jared That’s what I’m doing. I just got it working. The formula I used was:

=ACOS(COS(RADIANS(90- **lat1** )) \*COS(RADIANS(90- **lat2** )) +SIN(RADIANS(90- **lat2** )) \*SIN(RADIANS(90- **lat2** )) \*COS(RADIANS( **lon1** - **long2** ))) \*3958.756

I replaced the values in bold with actual cell references.

---

<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:** [September 13, 2020, 5:57am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/38 "2020-09-13T05:57:47Z")

</div>

The problem I’m having though – not to derail this thread but it is somewhat related – is that when I update a Google Sheet cell, it destroys the formulas in that row. So if I update A2, then the formula in A7 turns into a value rather than a formula.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 13, 2020, 7:16am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/39 "2020-09-13T07:16:44Z")

</div>

@tatiang It turns out that you need to rewrite the formula in the cell every time?

You tried to do this: place the formulas in a row that doesn’t change, for example, in row 1, and place the data for it in the cells of other rows 2 and higher.

---

<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:** [September 13, 2020, 7:32am UTC](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886/40 "2020-09-13T07:32:58Z")

</div>

@actech Yeah, that’s actually what I ended up doing. I just moved the data down one row so the header row is row 1 and the data is row 3. My formula is in row 2. But it’s just such a terrible workaround. I know, it works, but it’s not elegant. And I tried two sheets instead – one for the updated data and one for the static data with formula – but Thunkable ignored the “Sheet” value in the update value block. Ugh.

[Previous page](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886.md?page=1)

[Next page](https://community.thunkable.com/t/null-values-returned-by-google-distance-matrix/804886.md?page=3)
