0

I need to get AssignedToId, I have threshold 5000 items so i can't using filter. This code throws error at : AssignedTo.Id. Help me fix this?

$.ajax({
   url: "<domain>/_api/lists(guid'285E8476-12D6-44BE-BFB2-C8810B96165C')/items",
   type: "GET",
   headers: {"Accept": "application/json; odata=verbose"},
   success: function (data){
     var dataArray = data.d.results;
         for (var i in dataArray) {
            if(dataArray[i].Status!='Chua Ba´t dâ`u'&&dataArray[i].AssignedTo.Id==_spPageContextInfo.userId){ 
                $("#container-tqv").append("<div>"+  data.d.results[i].Title+ " </div>"); 
            }
         }
        dfd.resolve();
    },
   error: function(response){ 
        console.log('khong the load duoc do: '+ response.statusText); 
        dfd.reject();
   }

});

1

Please check your URL. "Web" seems to be missing in your URL :

Please try to Use below URL :

url : "<domain>/_api/web/lists(guid'285E8476-12D6-44BE-BFB2-C8810B96165C')/items"

Reference : https://msdn.microsoft.com/en-us/library/office/dn292552.aspx

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.