Binding SharePoint list data with Knockout js using REST API in O365 RRS feed

  • Question

  • Hi,

    I am trying to bind data of SharePoint list using REST API and Knockout js in 0365.

    I am getting error "Unable to bind observable- Title is not defined"

    This is my javascript code:              

    function insightViewModel() {
        var self = this;
        self.insights = ko.observableArray([]);
                    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('EmployeeDetailsList')/items?$select=Title,uu8e,EmployeeId",
                    type: "GET",
                    headers: {
                        "accept": "application/json;odata=verbose",
                    error: function (error) {
        function success(data) {
    alert(data.d.results[0].Title + " - " + data.d.results[0].EmployeeId);
    $(document).ready(function() {
      ko.applyBindings(new insightViewModel());

    And this my HTML code:

    <tbody data-bind="foreach: insights">
             <td data-bind="text: Title">
             <td data-bind="text: EmployeeId">

    Thursday, April 13, 2017 6:43 PM

All replies