Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

REST API $filter on custom property

$
0
0

Hi all,

I just ran into a issue when trying to filter the subwebs of a Site Collection using the REST API.

I setup all my subwebs created from a custom WebTemplate with the following property in the PropertyBag :

'org.webtemplateid' = 'org.projectname.templatename' (replacing values by the good ones, related to the context)

If there is some subwebs, created by the users, which dontt have my WebTemplate applyied to them, then they don't have any property named 'org.webtemplateid' in their PropertyBag. Hense, when I call this URL :

https://<tenant>/sites/<sitecoll>/_api/web/webs?$expand=AllProperties&$select=AllProperties/org.webtemplateid&$filter=AllProperties/org.webtemplateid eq 'org.projectname.templatename'

I get this error :

{"error" : {"code" : "-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message" : {"lang" : "en-US","value" : "Field or property \"org.webtemplateid\" does not exist."
		}
	}
}

because of these few sites without the custom property.

Is there a work around to avoid this issue ?

Thank you.




Viewing all articles
Browse latest Browse all 10096

Trending Articles



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