none
querying blog list RRS feed

  • Question

  • I'm creating a web part that is going to query the blog list in a blog site. I'm able to pull the columns out just fine, however, when I try to query the {Body} column to get the actual text of the blog, I'm getting [undefined]. I'm using SPServices for my calls

    my code looks like this:

     operation: "GetListItems",
                    async: true,
                    listName: "Posts",
                    CAMLQuery:  "<Query><OrderBy><FieldRef Name='PublishedDate' Ascending='True' /></OrderBy></Query>",
                     CAMLRowLimit: 5,
                    completefunc: function (xData, Status) {
                        $(xData.responseXML).SPFilterNode("z:row").each(function () {
                       	    title = $(this).attr("ows_Title");
                         	    description = $(this).attr("ows_Body");

    and I get [undefined] when trying to query the ows_body, however, if I use U2U CAML Query Builder, the text in the body column queried but it has HTML tags in it, could that be the cause of the [undefined] error message?

    any suggestions on querying that column from the blog list for my web part?

    Wednesday, June 3, 2015 3:55 PM

Answers

All replies

  • I fixed it, I had to add [body] to the default view and it worked
    Wednesday, June 3, 2015 4:45 PM
  • Hi,

    Thanks for sharing! It will help others who suck with the problem!

    Best Regards,

    Dennis


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, June 4, 2015 1:27 AM
    Moderator