Trying to get SharePoint data

Trying to get SharePoint data

BPATBPAT Posts: 28Questions: 13Answers: 1

Hello,

I am very new to this and to coding in general. I am trying to get some information from SharePoint.

So far I have this:

$('#example').dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "r4rz" },
{ "mData": "Usage" },
{ "mData": "LOB" },

},
{ "mData": "QStructure" }
]
});

Everything works except the Usage column which gives me [object[Object].

I have tried mrender on that but I can't get it to show what I want.

When I do this
items=data.d.results;
console.log(items[1].LOB.results[0].Title);

I get a title. How would I set up the LOB in the mdata to get the associated titles with each row of LOB?

Sorry if this is a dumb question or if I've asked it wrongly.

Replies

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Can you link to a test page showing the issue please (per the forum rules)? Or could you console.log( JSON.stringify( data.d.results ) ); so we can see the data please.

    Allan

  • BPATBPAT Posts: 28Questions: 13Answers: 1

    I hate to admit this, but I figured it out. It was my own cluelessness.
    This worked for me. Sorry to have taken up anyone's time reading this.

    { "mData": "Usage.results",
    "mRender": "[</br> ].Title"
    },

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    No worries - good to hear you've got it sorted!

    Allan

This discussion has been closed.