web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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

  • _Lars_ Profile Picture
    225 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans