Filter documentset folder by contenttype
Posted: 14 Sep 2018
Hi,
I'm trying to create a lookup field to only show the documentset folders by it's contenttype and not the documents inside the folder. However, it shows me everything. Any idea what i'm doing wrong?
I'm trying to create a lookup field to only show the documentset folders by it's contenttype and not the documents inside the folder. However, it shows me everything. Any idea what i'm doing wrong?
Code: Select all
function (term, page) {
if (! term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10&" +
"$filter = ContentTypeId eq '0x0120D5200097EED96070EB744C944BEB52EF7A3775'";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&" +
"$filter=startswith({LookupField},'" + encodeURIComponent (term) + "') and " +
"ContentTypeId eq '0x0120D5200097EED96070EB744C944BEB52EF7A3775'&$top=10";
}