2

I'm looking to get a certain set of data from my list using the listdata.svc service with AJAX. The problem is inside the list I have folders, and I'd like to only receive elements inside a certain folder.

The list looks like this:

myList //list
    --> Folder001 //folder
        --> Item01 //listitem
        --> Item02 //listitem
        --> Item03 //listitem
    --> Folder002 //folder
        --> Item01 //listitem
        --> Item02 //listitem

So far I've found that I can add the attribute ?$filter= to the address but can't figure out how to use it to my advantage.

I see that each element has a "Path" value which ends with the folder. How would I go about only retreiving those entries from list whose "Path" attribute ends with a certain value, say "Folder0001"?

4

You can use $filter query string and a property called "Path" like

/_vti_bin/Listdata.svc/myList()?$filter=endswith(Path, 'Folder001')

to get only the items from the Folder001

  • Glad we found a solution. It was an interesting question. – Anatoly Mironov Aug 16 '12 at 12:07

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.