I'm trying to filter my results from a Rest Call.
Aug 29, 2018 Hi Im trying to delete attached item from list items first and then upload new attach file in sharepoint using pnp js (in vuejs)! I trace the code and delete part is runnging but i dont konw why attached file doesnt delete!!! In this article, we can have a look at how to perform filter and expand operation on a SharePoint look up field using PNP JS Core and Angular Js in a SharePoint AddIn Custom Action. To simulate this scenario, I have created 2 custom lists named Technologies and projects with below fields Technologies.
In my Contacts List i'm trying to retrieve the Title and the Id for Items which start with a String or which have the String somewhere in it, here for example it is the Name of somebody.
I also tried it with substringof:
which delivers also the same result.
It gives me all List Items from the List and no Filtering is applied.I build the Url for the Rest after looking here Programming using the SharePoint 2013 REST serviceLike the Schema given there I think the Url looks ok, but it not seems so :)
Edit:
Applying the $filter
like in the OData Uri Conventions gives me the following error:
Tried it with following Query Strings:
I've managed to get the filter with substringof returning the correct results when I removed the 'eq true'.
Using one of your query strings, it should work like this:
I haven't checked any other functions, but at least, the same happens with startswith function.
For anyone looking at this question, I can report that
IS working for me.
I tried your query URI on my endpoint and applied some changes:- The second parameter of the substring shouldn't be a string, so I removed the apostropes
After this I get the results:
http://jaydata.org/examples/Northwind.svc/Products?$select=Product_ID,Product_Name&$filter=substringof('CH',Product_Name)
My endpoint is standard WCF Data Service, and the filter is working.
If changing the URI still returns all records, that would be a SherePoint trick I guess. What happens if you put 'zzz' or some random string in the filter?
Check http://www.odata.org/documentation/odata-v2-documentation/uri-conventions/ for the correct uri convention.
Should be
So with the $filter included
Also, the contains method works and I've had better compatibility with it. The syntax is: