2

I'm trying to get documents from a document library where ServerRedirectedEmbedUrl not equal empty, I'm trying something like this:

https://my-sharepoint/sites/mysite/_api/lists/getbytitle('Documents')/items?$select=ServerRedirectedEmbedUrl,Title,File&$expand=File&$filter=ServerRedirectedEmbedUrl ne " "

But this give me error Column 'ServerRedirectedEmbedUrl' does not exist. It may have been deleted by another user

What am i doing wrong?

If somebody can bring me some help on this i'll appreciate it!

Thanks in advance.

3
  • I don't think it can be filtered on the request (at least I can't get it to), worst case you omit the filter and skip over the entry in the result set? Jan 19, 2017 at 16:32
  • @EricAlexander I have the same problem, can you explain that with more details please? Jan 24, 2017 at 20:52
  • 1
    @EmmanuelVillegas i forgot to circle back to this, supplied a rough example Jan 24, 2017 at 21:42

1 Answer 1

2

I messed around with this for a bit and I don't think the property is filterable. That means you'll have to request a bigger result set and filter it on the success function. It would look something like this:

$.ajax({
    url: "https://my-sharepoint/sites/mysite/_api/lists/getbytitle('Documents')/items?$select=ServerRedirectedEmbedUrl,Title,File&$expand=File",
    method: "GET",
    headers: {
        "Accept": "application/json; odata=verbose",
        "Content-Type": "application/json; odata=verbose"
    },
    success: function(data){
       $(data.d.results).each(function(){
        if(!this.ServerRedirectedEmbedUrl.length){
            console.log(this);
        };
       });
    },
    error:function(){
        //do something
    }
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.