<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OData Filter by Multi value 'in()' for Javascript not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681958#M2017036</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;klaudry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;According to this &lt;A href="https://stackoverflow.com/questions/76247838/odata-filter-by-multi-value-in-not-working" target="_blank"&gt;Stack Overflow post&lt;/A&gt;, the correct syntax for using the &lt;CODE&gt;in()&lt;/CODE&gt; operator in OData is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;$filter=substringof('COFFE', searchKey) and (origin eq 'BRA' or origin eq 'COL')
&lt;/CODE&gt;&lt;/PRE&gt;Copy&lt;P&gt;The syntax you mentioned is incorrect:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;$filter=substringof('COFFE', searchKey) and origin in ('BRA', 'COL')
&lt;/CODE&gt;&lt;/PRE&gt;Copy&lt;P&gt;I hope this helps. Let me know if you have any other questions.&lt;/P&gt;</description>
    <pubDate>Sun, 14 May 2023 14:27:30 GMT</pubDate>
    <dc:creator>Yogananda</dc:creator>
    <dc:date>2023-05-14T14:27:30Z</dc:date>
    <item>
      <title>OData Filter by Multi value 'in()' for Javascript not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681957#M2017035</link>
      <description>&lt;P&gt;Hi, I'm using OData client v2 for my VUEJS app and trying to filter like this&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;$format=json&amp;amp;$top=50&amp;amp;$filter=substringof('COFFE', searchKey) and (origin eq 'BRA' or origin eq 'COL')&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;according to this &lt;A href="https://github.com/Soontao/light-odata/blob/HEAD/docs/API.ODataFilter.md#odatafilter"&gt;light OData documentation&lt;/A&gt; we can use &lt;STRONG&gt;in() &lt;/STRONG&gt;like this&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;$filter=substringof('COFFE', searchKey) and origin in ('BRA', 'COL')&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;the first one with 'OR()' works, but the second with 'IN()' unfortunately is not working, any idea? &lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 13:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681957#M2017035</guid>
      <dc:creator>klaudry</dc:creator>
      <dc:date>2023-05-14T13:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: OData Filter by Multi value 'in()' for Javascript not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681958#M2017036</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;klaudry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;According to this &lt;A href="https://stackoverflow.com/questions/76247838/odata-filter-by-multi-value-in-not-working" target="_blank"&gt;Stack Overflow post&lt;/A&gt;, the correct syntax for using the &lt;CODE&gt;in()&lt;/CODE&gt; operator in OData is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;$filter=substringof('COFFE', searchKey) and (origin eq 'BRA' or origin eq 'COL')
&lt;/CODE&gt;&lt;/PRE&gt;Copy&lt;P&gt;The syntax you mentioned is incorrect:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;$filter=substringof('COFFE', searchKey) and origin in ('BRA', 'COL')
&lt;/CODE&gt;&lt;/PRE&gt;Copy&lt;P&gt;I hope this helps. Let me know if you have any other questions.&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 14:27:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681958#M2017036</guid>
      <dc:creator>Yogananda</dc:creator>
      <dc:date>2023-05-14T14:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: OData Filter by Multi value 'in()' for Javascript not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681959#M2017037</link>
      <description>&lt;P&gt;Since your URL has "substringof" rather than "contains", I assume that the server is implementing OData V2.&lt;/P&gt;&lt;P&gt;The "in" operator is defined only since OData V4, e.g. &lt;A href="http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31360968" target="test_blank"&gt;http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31360968&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(Even then, a V4 server might or might not support it).&lt;/P&gt;&lt;P&gt;So for a V2 service using the "or" operator might be the only available choice.&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 23:01:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-filter-by-multi-value-in-for-javascript-not-working/m-p/12681959#M2017037</guid>
      <dc:creator>evanireland</dc:creator>
      <dc:date>2023-05-14T23:01:14Z</dc:date>
    </item>
  </channel>
</rss>

