TrueWay Matrix

FREEMIUM
Verified
Door TrueWay Team | Bijgewerkt 23 days ago | Mapping
Populariteit

9.8 / 10

Latency

264ms

Serviceniveau

100%

Health Check

N/A

Terug naar alle discussies

Excel WEBSERVICE code for implementation

Rapid account: Gonellacarlo
gonellacarlo
10 days ago
As in Title, which is the correct way to implement the code in Excel Cell for distance calculation ? 

Thanks
Rapid account: Trueway
trueway Commented 10 days ago

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

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen