Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

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

  • Suggested answer
    manuel_rdza Profile Picture
    manuel_rdza 5 on at
    RE: O Data Expand & Filter

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

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

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: O Data Expand & Filter

    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
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: O Data Expand & Filter

    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

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans