Google Distance Matrix API

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • Answered
I would like to see if there is a way for me to create an API that will call into Google Distance Matrix API and return the distance a worker's home is from the job site. I was able test the API in Postman but I am having a hard time adding it to Quickbase. Not sure if I should do this with a formula URL field or a webhook
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 2
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
Generally this requires custom coding depending on your exact needs.  

Are you looking to just have a button that pulls up the map w/ directions?   (this is an easy button, that I can share if needed)

Or something that is automatic when a worker is assigned to a job site?  (This is much more advanced)
Photo of Jacob

Jacob

  • 738 Points 500 badge 2x thumb
The first button sounds interesting if you are willing to share it I would love to see how it works!  Thanks!
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
Matthew,
Thanks for your resoonse!
I am looking for something that will go to google and get the distance when a worker is assigned to the job. Can you give me some pointers?
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
https://developers.google.com/maps/documentation/javascript/3.exp/reference

This is something we have done several times.  If you need help implementing this on your app, feel free to contact me ( Matthew@cirrusops.com) or another QuickBase Developer if you choose.
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
Thank you!
Photo of Matthew Neil

Matthew Neil

  • 31,478 Points 20k badge 2x thumb
Directions Button,

This is formula URL button:

"https://www.google.com/maps/dir/"&URLEncode([Resource - Home Address])
&"/"&URLEncode([Project Location])

This is just a URL Button that will go to google maps.  Both of those field are full address fields being referenced.
(Edited)
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
Thank you!
Any way I could get you to point me in the right direction for the automated way?
Can I use a webhook to get the information and then post it somehow on to a field?
Again, thanks for taking the time to help me!!
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
I know... It would be great if they would at least add some Trig functions in there (Sin, Cos...) that way we could use them to calculate as crow flies.
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
An example would be great! 

Thank you!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,766 Points 50k badge 2x thumb
Here is the non trigonometry solution. No Sin and Cos requires because in fact the earth is flat. https://community.quickbase.com/quickbase/topics/is-there-a-formula-within-quickbase-that-would-calc...
Photo of @lin

@lin

  • 820 Points 500 badge 2x thumb
This is awesome! The earth is flat... The people in the middle ages were right after all :)
I'll try your approach.

Thank you!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,694 Points 20k badge 2x thumb
The Earth is an oblate spheroid.