I have a module where am trying to get data from a SharePoint list and display it in a SharePoint page. First, I am showing the first 10 items without doing any filtering like this, where my REST query looks like this:
var newsQuery = _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getByTitle('News')/items?$orderby= PublishDate desc&$top=10";
After that, when the news is displayed to the user, he can choose the country for that neww from a dropdown, then the type of the news from 1 of few checkboxes, so when filtering based on the country the news query would, I wrote code that will generate a query that looks like this:
"http://website.com/_api/web/lists/getByTitle('News')/items?$orderby= PublishDate desc&$top=10&$filter=(Country eq 'USA')"
The initial query works fine on production AND staging, also filtering the news by country works on both environments. I am having a problem when filtering based on one of the checkboxes. The code I wrote generates this query:
"http://website.com/_api/web/lists/getByTitle('News')/items?$orderby= PublishDate desc&$top=10&$filter=(Country eq 'USA') and (Sports gt 0)"
In my case, a news can have multiple categories, so a user can choose more than 1 checkbox for a country, in my SharePoint list, there are single line of text fields, representing the news categories, with description for each one filled in that category, so I want to get the ones that have Sports filled.
The query works in development environment, and on staging.
It works on production for few categories, sports, finances,etc.. but not for a few other categories.
Did anyone face such issues with REST? maybe with HTTPS? as it's an internet site.
Getting ALL items works on dev/staging/prod
Filtering for countries works on dev/staging/prod
Filtering on categories (single line of text in the list) works for few columns in prod, but works for all columns in dev/staging.