Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Combine Filter Expression in OData feed

Posted on by Microsoft Employee
I know from this source https://msdn.microsoft.com/en-us/library/hh169248(v=nav.90).aspx,
that i can filter data from my Odata-feed like this: localhost/.../Company('CRONUS International Ltd.')/Customer?$filter=City eq 'Miami'

But how should the URL look, if i want to specify $format=json, too?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Combine Filter Expression in OData feed

    I got it. I have to use "&$" to combine two filters.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Combine Filter Expression in OData feed
    I can´t find a solution.

    1 This works: localhost/.../Company('CRONUS International Ltd.')/Customer?$filter=City eq 'Miami'
    2 This works: localhost/.../Company('CRONUS International Ltd.')/Customer?$format=json
    3 This doesn´t:localhost/.../Company('CRONUS International Ltd.')/Customer?$format=json$filter=City eq 'Miami'
    4 This doesn´t:localhost/.../Company('CRONUS International Ltd.')/Customer?$filter=City eq 'Miami'$format=json

    Error for 3 is: Unsupported media type requested.
    Error for 4 is: Syntax error at position 80 in 'Order_Date gt datetime'2017-11-30' and Order_Date lt datetime'2018-01-01'$format=json'.

    Does anybody have further ideas?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Combine Filter Expression in OData feed

    Thank you very much!

    I´m afraid  localhost/.../Company('CRONUS%20India%20Ltd.')/Myquery?$filter=Location_Code eq 'BLUE' & $format=json doesn´t work.  I get a 401 error... mhm.

  • Manish Sinha Profile Picture
    Manish Sinha 18 on at
    RE: Combine Filter Expression in OData feed

    Hi Niels,

    The URL should include the format=json to obtained a document.

    In NAV 2016 environemtn the URL is : localhost/.../Company('CRONUS%20India%20Ltd.')/Custmers?$filter=Location_Code eq 'BLUE' & $format=json

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans