Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How can I use geo.distance filter in my query?

(0) ShareShare
ReportReport
Posted on by 225

Hello!

I want to poll every object of the entity pss_assets from Dynamics, the entity holds the fields pss_latitude and longitude.

I've tried the following query, but I get "400 Bad Request" with very little else information;

req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/pss_assetses?$filter=geo.distance(geography'POINT(56.158445 10.218658)', geography'POINT(pss_latitude pss_longitude)') le 10", true);

Does anyone else had success with this filter? What I want is to get all objects within 10 kilometers (there is still that 5000 object limit).

*This post is locked for comments

  • _Lars_ Profile Picture
    _Lars_ 225 on at
    RE: How can I use geo.distance filter in my query?

    Hello Guillaume,

    I cant see how I can do it with that tool. It has simple property comparison.

    I should be able to do this with the $filter=geo.intersects from docs.microsoft.com/.../odata-expression-syntax-for-azure-search but as I was saying I'm getting 400.

  • Suggested answer
    RE: How can I use geo.distance filter in my query?

    Hello,

    did you try to check your query with the helpfull CRMRest Builder?(https://github.com/jlattimer/CRMRESTBuilder)

    simply import the managed solution, open it and create your query.

    Best

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans