How Can I calculate distance between 2 address and pick up the kilometers ?

  • Wilson_R
    Asked on January 25, 2019 at 9:48 AM

    Hi Jotform team,


    I would like to calculate distance between two Brazil address and pick up the kilometers.

    I tried using the following widget, but it´s not worked 


    https://form.jotformz.com/90234941110647


    Could you please help me ? 


    I really aprreciate your prompt support


    Thank you,


    Wilson from Brazil

  • Nick_So
    Replied on January 25, 2019 at 12:38 PM

    To calculate the distance "Driving Distance Widget" is used which is already added in your form. The calculation is not working because you have exceeded your Geolocation API limit.

    Please see the screenshot below. 

    How Can I calculate distance between 2 address and pick up the kilometers ? Image 10

    To fix this error, you need to add Google API key in your form. Please see the screenshot below to add the key.

    How Can I calculate distance between 2 address and pick up the kilometers ? Image 21

    To generate your own your Google API key, please refer the guide below. 

    https://developers.google.com/maps/documentation/embed/get-api-key


  • Wilson_R
    Replied on January 25, 2019 at 6:37 PM

    Thank you so much! 

    I added Google API Key in the form and it is working now, but I need to pick up the kilome

    ters and saved it int the some field in the form.

    Could you help me please ?

    https://form.jotformz.com/90234941110647




  • Jed_C
    Replied on January 25, 2019 at 8:48 PM

    You can create a condition that passes the value from Driving Distance Widget to a text field.

    ex.

    1548467133The Easiest Online Form Builde Screenshot 10

    It should fill the information like this:

    1548467230The Easiest Online Form Builde Screenshot 21

    Reference guide: https://www.jotform.com/help/268-How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic 

    I hope that helps. Let us know if you have any questions or if you need further assistance. 

  • Wilson_R
    Replied on January 29, 2019 at 10:55 AM

    Thank you! I created a condition and worked perfect.

    Now, I need to pick up the address and saved it in the field.

    It´s possible ?


  • BJoanna
    Replied on January 29, 2019 at 12:12 PM

    That is not possible. Considering that this widget is used to calculate distance, you can only pass a distance to some other form field.