I want to filter the field with data type Multi line text, but somehow am not able to filter that. I guess this didn't work as it contains html code within it, between the div tag my text appears.

Below is the filter URL

url :_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Site')/items?$select=Title,Keywords&$filter=Keywords contains 'test'"

Any help would be appreciated

1 Answer 1


Try it as below:

_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Site')/items?$select=Title,Keywords&$filter=substringof('test',Keywords)

If that doesnt work, you need to create a POST request as below:

function postJson(endpointUrl,payload,success,failure)
      type: "POST", 
      headers: { 
            "accept": "application/json;odata=verbose",
            "content-type": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val()
      data: JSON.stringify(payload),
      url: endpointUrl, 
      success: success,
      failure: failure 

function getListItems(listTitle, queryViewXml,success,failure)
   var queryPayload = { 
           '__metadata': { 'type': 'SP.CamlQuery' },
           'ViewXml': queryViewXml
   var endpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/getitems";

How to use it:

getListItems('Site',"<View><Query><Where><Contains><FieldRef Name='Keywords'/><Value Type='Note'>test</Value></Contains></Where></Query></View>",
      for(var i = 0; i < items.length; i++) {

Reference - Using CAML with REST API

  • 1
    Time we learn people Functional Programming, Gautam. Your for loop has a typo, always displays all items. In FP that typo is difficult to make; its items.forEach(function(item){console.log(item)}) Since it takes a Function (that's why its called Functional Programming.. its not magic); you could do items.forEach(console.log) that will log all 3 parameters: value, index (the i in your for loop) and the whole array items Feb 24, 2017 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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