Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Querying Folders with metadata in a document library with REST

$
0
0

Hi,

I have a situation whereby someone is using Folders within Folders in a document library (Don't Ask!). The folders themselves have metadata against them. I want to be able to perform a REST query to get certain folders inside the folder which have a particular metadata value. I have tried all sorts of queries but the filter either doesn't do anything or it comes back saying the Field or Property doesn't exist. I am at the point of pulling my hair out. I have put below an example and also some example queries I have tried.

The metadata field is a Yes/No checkbox called Active which i believe you query against using 1 for True and 0 for False.

Library

Folder1

Sub Folder1 (Active: Yes)

Sub Folder2 (Active: No)

Folder2

I want to return the Sub folders in Folder1 whereby Active is equal to Yes. Some of my attempts below:-

/sites/Site1/_api/web/lists/Getbytitle('Library')/rootfolder/Folders('Folder1')/Folders?$select=Properties/Active&$expand=Properties&$filter=Properties/Active eq 1

/sites/Site1/_api/web/lists/Getbytitle('Library')/rootfolder/Folders('Folder1')/Folders?$select=Properties/Active&$expand=Properties&$filter=Properties/Active eq true

/sites/Site1/_api/web/GetFolderByServerRelativeUrl('Library/Folder1')/folders?$select=Properties/Active&$expand=Properties&$filter=Properties/Active eq 1

/sites/Site1/_api/web/GetFolderByServerRelativeUrl('Library/Folder1')/folders?$select=Properties/Active&$expand=Properties&$filter=(Properties/Active eq 1)

Any guidance is greatly appreciated.

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>