I'm using the API to search for sitegroups as below:

"/_api/web/SiteGroups?$orderby 'Title'&$select=Id,Title,LoginName" + skiptop + "&$filter=startswith(Title,'" + value + "')"

However, I have the problem that in this case, the startswith filter is case sensitive. So, when a user searches for say "App" he gets Approvers, but when he searches for "app" he gets nothing.

I have tried tolower and other combinations of contains.. substringof..

Is there a way making the filter work?

  • I think there are some syntax error in given url, in orderBy and select cause. – Ganesh Sanap Feb 5 '19 at 12:55

You can use something like given below:

  1. Create a new variable for all lowercase value, like:

    var lowercaseValue = value.toLowerCase();
  2. Then add filter like given below:

    "$filter=startswith(Title,'" + value + "') or startswith(Title,'" + lowercaseValue + "')"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.