2

I am using jQuery to get information from SharePoint 2010's listData.svc. I noticed some inconsistencies with regards to case sensitivity in my queries:

  • The following command is case sensitive:

    ...&$filter=substringof('String', property) eq True

  • The following command is case insensitive

    ...&$filter=substringof(tolower('String'), tolower(property)) eq True

  • The following command is also case insensitive but much shorter:

    ...&$filter=substringof('String', property) or substringof('String', property2)

  • However, the case insensitivity using the short method is lost for the entire filter when one part is using a property more than two levels down. So in the following command the entire filter becomes case sensitive again:

    ...&$filter=substringof('String', property/property/property) or substringof('String', property2)

Is this an issue with SharePoint's service? Or am I just doing something wrong?

1 Answers1

0

It seems like a bug in ListData.svc.

If comparisons (delegated to SQL server at the end of the day) are case-sensitive in any query they should always be case-sensitive.

Clearly the tolower call makes things match whether cases match or not, so we can ignore that. However I have no idea why doing an OR on another property works.

Either it is a bug in SharePoint or perhaps you've inadvertantly picked an OR clause that returns the data your were expecting by accident.

Alex James
  • 20,874
  • 3
  • 50
  • 49