TrueWay Matrix

FREEMIUM
Verified
Durch TrueWay Team | Aktualisiert 2 mesi fa | Mapping
Popularität

9.8 / 10

Latenz

263ms

Service Level

100%

Health Check

N/A

Zurück zu allen Diskussionen

Excel WEBSERVICE code for implementation

Rapid account: Gonellacarlo
gonellacarlo
2 mesi fa
As in Title, which is the correct way to implement the code in Excel Cell for distance calculation ? 

Thanks
Rapid account: Trueway
trueway Commented 2 mesi fa

Hello,

Here is the example for you. I hope this will be helpful!

  1. Type “origin location” as a header in A1 and the origin location coordinates in A2. For Example: 40.629041,-74.025606.

  2. Type “destination location” as a header in B1 and the destination location coordinates in B2. For Example: 40.627177,-73.98086.

  3. Type “response” as a header in C1. Make the webservice call by typing in C2:
    =WEBSERVICE(“https://trueway-matrix.p.rapidapi.com/CalculateDrivingMatrix?origins="&A2&"&destinations="&B2&"&rapidapi-key=<your_rapidapi_key>”)
    Please replace <your_rapidapi_key> with your RapidAPI key.
    You should see a JSON response appear in the cell. Something like this: {“distances”:[[5404]],“durations”:[[1150]]}

  4. Type “distance” as a header in D1 and type in D2:
    =VALUE(MID(C2,SEARCH(""“distances”":[[",C2)+14,SEARCH("]]",C2,15) - (SEARCH(""“distances”":[[",C2)+14)))
    You should see a distance appear in the cell.

Please let us know if you have any questions.

Best regards,
TrueWay Team

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen