I'm trying to get a field named Content from list which is of type RichHtml. When I try to get this using REST api call, I'm getting the content the html tags. How can I get the value only from this field using a rest api call ?

  • "The value" has HTML tags in it, that what makes it a RichHTML field (the possiblity to use tags) – Robert Lindgren Mar 17 '14 at 8:19
  • How can I get the data only from that field? without tags ? – Anish V Mar 17 '14 at 8:19
  • I think you can't, you will have to parse the value you get and strip out any tags with for example some javascript method – Robert Lindgren Mar 17 '14 at 8:25
  • 1

In jQuery .text() function allows to extract text content from Html.


var query = "/_api/web/lists/getByTitle('Pages')/getItemById(1)";
    url: _spPageContextInfo.webAbsoluteUrl + query,
    type: "GET",
    headers: { "ACCEPT": "application/json;odata=verbose" },
    success: function(data){
      var pageContentText = $(data.d.PublishingPageContent).text();
    error:  function(data){

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.