Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Posts Tagged ‘startswith’

OData startswith Examples

Posted by Paul on June 30, 2015

In this article we can explore OData examples for string method startswith.

startswith

This filter returns the field values starting with specified string.

Please note that the method-name is case sensitive & only lower case works.

Example

Please create the data as shown below.

image

Following is the query URL.

http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=startswith(Title,’Bran’)

Following is the result using Chrome browser.

image

image

Please note that we are querying against column named Title.

Another Example

Now let us try with an non-existing string.

Following is the query URL.

http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items?$filter=startswith(Title,’ABCD’)

Following is the result using Chrome browser which shows no-results.

image

You can now play with more examples.

image

Please note that the operation name should be in lower-case.

References

https://msdn.microsoft.com/en-us/library/gg309461.aspx

Summary

In this article we have explored OData with method startswith.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »