web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Dynamics 365 Web API Built-in Query Function geo.distance does not work

(0) ShareShare
ReportReport
Posted on by 5

According to the oasis reference, there is an available built-in query Geo function named geo.distance that can be used in $filter in OData queries.

ref: http://docs.oasis-open.org/odata/odata/v4.0/os/part1-protocol/odata-v4.0-os-part1-protocol.html#_Toc372793694

my query:

{{my_api_url}}/accounts?$select=accountid,name&$orderby=accountid&$top=100&$filter=geo.distance(geography'POINT(136.62570190429688 36.594619750976563)',geography'POINT(136.625663 36.594671)') lt 900.0

When I execute the above query to retrieve Dynamics records, the following error was returned.


{
"error": {
"code": "0x0",
"message": "The \"geo.distance\" function isn't supported."
}
}


Does it mean Dynamics not supporting OData's geo.distance function? If there is anyone faced similar issues with Geo functions, how did you solved it? 
Any king of help regarding the geo.distance function is appreciated.

 

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    As far as I know, this is not supported in OOB webapi.

    I built such functionality for one of my customers a while ago and it was resolved through geocoding of all the accounts and development of the action that returned the recordset of accounts that were located nearby to the provided coordinates.

  • Alam UPWARD Profile Picture
    5 on at

    Hello Andrew,

    Thank you so much for the reply.

    "I built such functionality for one of my customers a while ago and it was resolved through geocoding of all the accounts and development of the action that returned the recordset of accounts that were located nearby to the provided coordinates."

    Do you mean,  you have created a custom action on Dynamics site to returned the recordset of accounts?

    Kind Regards

    Alam

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Alam,

    Yes, that's correct.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    If my reply (or replies) answers your question take a minute and verify the answer. You can do it by clicking "Yes" at the top of the reply (or replies) under the label "Does this answer your question?"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 162 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans