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.

  • 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? – Eric Alexander Jan 19 '17 at 16:32
  • @EricAlexander I have the same problem, can you explain that with more details please? – Emmanuel Villegas Jan 24 '17 at 20:52
  • 1
    @EmmanuelVillegas i forgot to circle back to this, supplied a rough example – Eric Alexander Jan 24 '17 at 21:42
1

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, privacy policy and cookie policy

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