Forum Discussion

AlinMihalcea1's avatar
AlinMihalcea1
Qrew Assistant Captain
8 years ago

Google Distance Matrix API

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
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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)
    • JacobJacob's avatar
      JacobJacob
      Qrew Cadet
      The first button sounds interesting if you are willing to share it I would love to see how it works!  Thanks!
  • AlinMihalcea1's avatar
    AlinMihalcea1
    Qrew Assistant Captain
    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?
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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.
  • AlinMihalcea1's avatar
    AlinMihalcea1
    Qrew Assistant Captain
    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!!
    • JacobJacob's avatar
      JacobJacob
      Qrew Cadet
      I agree with this is there anyway to enter two addresses on the QuickBase record and have the Google API calculate the distance and then have it shown on the QuickBase record? 
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      We are all hoping for a day soon where QuickBase exposes the "geocoding" (lat & long) of an Address field to use as an automatically populated field associated with an Address field.  When that day comes, this will be a lot easier to calculate the distance - not the driving distance, but at least the "as the crow flies" distance - a straight line.