Skip to main content
All CollectionsAutomationFunctions
Function CurrentRoute()
Function CurrentRoute()

Use CurrentRoute() to get the traveling distance or time in your 'Match record' action

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

CurrentRoute() can only be used in a Match record action - to get the traveling distance and time between the action's base record and the current match candidate (when used in a Match record action's Rating formula) or the matched record (when used in Match record action's Match actions).

The function works exactly like the Route() function with the only exception that it always builds the route from the base record's location to the matching record, so it doesn't accept coordinates in its input.

If you need to get the distance or time from the matching record's location to the base record's location, use the Route() function to pass the coordinates explicitly.

How to use

  • CurrentRoute()

  • CurrentRoute(params)

Input

Output

See Output of the Route() function.

Example

  • -CurrentRoute().distance in the Match record's Rating formula (with the minus sign at the start!) to find the closest record to the base location by the driving distance.
    โ€‹

  • CurrentRoute({useTraffic: true}).time in an Update record action added to the Match record's Match actions will let you save the driving time from the base record to the matched record with the current traffic taken into account.

See also

Did this answer your question?