{"id":6042,"date":"2020-03-17T09:24:38","date_gmt":"2020-03-17T09:24:38","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6042"},"modified":"2020-03-17T09:24:38","modified_gmt":"2020-03-17T09:24:38","slug":"rest-api-filter-methods-on-sharepoint-list-items","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/","title":{"rendered":"Rest API Filter Methods On SharePoint List Items"},"content":{"rendered":"\n<p>In this blog we will see how to filter SharePoint list items using Rest API. We can filter items based on <em>field title, field ID or modified date<\/em> of items. &nbsp;In Rest API through&nbsp; url parameter we can easily perform filtering on SharePoint list items. For filter methods url parameter is composed of three components.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Field\nname<\/li><li>Operator\nsuch as eq,lt,le,gt,ge,ne<\/li><li>Value\nfor filtering<\/li><\/ul>\n\n\n\n<p>In this blog we have a custom list \u201cEmployee\u201d. We will filter the employee name having age greater than 30.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/1.png\" alt=\"\" class=\"wp-image-6043\" width=\"441\" height=\"565\"\/><\/figure><\/div>\n\n\n\n<p>Add a script\neditor on your home page. Go to edit mode and these below codes in script\neditor webparts.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>&lt;script   src=&#8221;https:\/\/ajax.aspnetcdn.com\/ajax\/jQuery\/jquery-3.2.1.min.js&#8221;&gt;&lt;\/script&gt;   <br>&lt;script&gt;   <br>$(function(){   <br>$(&#8220;#btnClick&#8221;).click(function(){   <br>var requestUri =   _spPageContextInfo.webAbsoluteUrl +   <br>&#8220;\/_api\/web\/lists\/getByTitle(&#8216;Employee&#8217;)\/items\/?$filter=Age gt 30&#8221;;   <br>$.ajax({   <br>url: requestUri,   <br>type: &#8220;GET&#8221;,   <br>headers: {   <br>&#8220;accept&#8221;:&#8221;application\/json;   odata=verbose&#8221;   <br>},   <br><br>success: onSuccess,   <br>error: onError   <br>});   <br><br>function onSuccess(data) {   <br>var items = data.d.results;   <br>var result=&#8221;&#8221;;  <br>for (var i = 0; i &lt; items.length;   i++) {  <br>result +=items[i].Id+ &#8221; : &#8221;   + items[i].First_x0020_Name +&#8217;\\n&#8217;;   <br>}   <br>alert (result);   <br>}   <br>function onError(error) {<br>   <br>alert(JSON.stringify(error));   <br>}   <br>});  <br>});   <br>&lt;\/script&gt;   <br><br>&lt;input type=&#8221;button&#8221;   id=&#8221;btnClick&#8221; value=&#8221;Filter List Items By Title(Age greater   Than 30)&#8221;\/&gt;   <\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>After saving\nthe page you will see a button has been added to the homepage.<\/p>\n\n\n\n<p><strong><em>Result:<\/em><\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/2-1024x272.png\" alt=\"\" class=\"wp-image-6044\" width=\"720\" height=\"191\"\/><\/figure><\/div>\n\n\n\n<p>Click on the button displays an alert showing all employee\u2019s ID and name having age greater than 30.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/3-1024x309.png\" alt=\"\" class=\"wp-image-6045\" width=\"719\" height=\"217\"\/><\/figure><\/div>\n\n\n\n<p><strong><em>Keywords:<\/em><\/strong><\/p>\n\n\n\n<p>Applying Rest API filter query method on Sharepoint List Items<br>Sharepoint Using Rest API for filtering Sharepoint List Items<br>SharePoint Rest API Filter Example<br>Rest API Filter Conditions on Sharepoint<br>Rest API Filter Methods On SharePoint ListItems<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog we will see how to filter SharePoint list items using Rest API. We can filter items based on field title, field ID or modified date of items. &nbsp;In Rest API through&nbsp; url parameter we can easily perform filtering on SharePoint list items. For filter methods url parameter is composed of three components. Field name Operator such as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-6042","post","type-post","status-publish","format-standard","hentry","category-sharepoint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Rest API Filter Methods On SharePoint List Items - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Rest API Filter Methods On SharePoint List Items - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this blog we will see how to filter SharePoint list items using Rest API. We can filter items based on field title, field ID or modified date of items. &nbsp;In Rest API through&nbsp; url parameter we can easily perform filtering on SharePoint list items. For filter methods url parameter is composed of three components. Field name Operator such as [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-17T09:24:38+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Rest API Filter Methods On SharePoint List Items - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/","og_locale":"en_US","og_type":"article","og_title":"Rest API Filter Methods On SharePoint List Items - Softree Technology","og_description":"In this blog we will see how to filter SharePoint list items using Rest API. We can filter items based on field title, field ID or modified date of items. &nbsp;In Rest API through&nbsp; url parameter we can easily perform filtering on SharePoint list items. For filter methods url parameter is composed of three components. Field name Operator such as [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/","og_site_name":"Softree Technology","article_published_time":"2020-03-17T09:24:38+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Rest API Filter Methods On SharePoint List Items","datePublished":"2020-03-17T09:24:38+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/"},"wordCount":294,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/1.png","articleSection":["SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/","name":"Rest API Filter Methods On SharePoint List Items - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/1.png","datePublished":"2020-03-17T09:24:38+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#primaryimage","url":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/1.png","contentUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/03\/1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/rest-api-filter-methods-on-sharepoint-list-items\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Rest API Filter Methods On SharePoint List Items"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=6042"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6042\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}