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)
Suggested Answer

O Data Expand & Filter

(0) ShareShare
ReportReport
Posted on by 545

I am using following URL, api/data/v8.2/products?$expand=product_price_levels($select=amount&$filter=_uomid_value)

 its giving me Error code as Found an unbalanced expression.

I tried with values  of product & UOMID too, still the same

*This post is locked for comments

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

    Unfortunately it is not possible to build OData query that will include expand on related entity and filter on it . Either you can reverse the query or

    You work with Dynamics CRM 2016 new WebApi can use clear FetchXml for data querying. Recheck following articles:

    debajmecrm.com/.../leverage-web-api-to-execute-your-system-views-personal-views-and-custom-fetchxml-in-dynamic-crm-2016 community.dynamics.com/.../execute-fetchxml-using-web-api-in-dynamics-crm-2016

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    Hi Ganesh,

    the syntax of your query is wrong. In an expand query you can only use $select.

    More Details here:

    msdn.microsoft.com/.../gg334767.aspx

    Your query would work with this URL:

    /api/data/v8.2/products?$expand=product_price_levels($select=amount)

    or this if you query by the product ID:

    /api/data/v8.2/products(A54BB1D0-6BC0-E611-80F5-5065F38BD4F1)?$expand=product_price_levels($select=amount)

    Results will have odata.nextLink properties:

    Unless you specify a smaller page size, a maximum of 5000 entities will be returned for each request. If there are more entities that match the query filter criteria, a @odata.nextLink property will be returned with the results. Use the value of the @odata.nextLink property with a new GET request to return the next page of data.

    Depending on what result you would like to get it might make more sense to completely change the URL query to query by the Price Levels on the product field via its ID.

    Cheers,

    Andreas

  • Suggested answer
    manuel_rdza Profile Picture
    5 on at

    Inside the $expand, try separating the clauses with semicolons:

     api/data/v8.2/products?$expand=product_price_levels($select=amount;$filter=_uomid_value)

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