hrossi hrossi - 24 days ago 14
jQuery Question

SharePoint ListData.svc "contains" string filter operator

I'm using getJSON to retrieve list items from SharePoint like this:


[site url]/_vti_bin/listdata.svc/Keywords?filter=startswith(Title,'r')


I want to change it to retrieve this:


[site url]/_vti_bin/listdata.svc/Keywords?filter=contains(Title,'r')


which fails. Is there a "contains" operator for ListData.svc?

Answer

the good syntax is:

 [site url]/_vti_bin/listdata.svc/Keywords?$filter=substringof('r',Title) 

All operators are listed here : http://msdn.microsoft.com/en-us/library/cc907912.aspx