I'm use camel query for pages library to get pages created using ArticlePage.aspx layout.

also add filter with department and location value to match.

The query shows result in U2U Camel Query Builder.

But when I have used this query in code. that time it returns no result.

<And><Contains><FieldRef Name="PublishingPageLayout" />
<Value Type="URL">ArticlePage.aspx</Value></Contains>
<FieldRef Name="UserDepartment" /><Value Type="Choice">Dev</Value>
<FieldRef Name="UserLocation" /><Value Type="Choice">US</Value>
<OrderBy><FieldRef Name="Created" Ascending="False" /></OrderBy>
  • Are you using CSOM or Server model? there a little difference in how you set the CAML – Marco May 4 '17 at 15:07

Try this link for creating a CAML query. It shows how one can create CAML query using CamlJs-Console which is a Chrome extension.


Try typing a complete link to the page, instead of just the page name. ArticlePage.aspx


Most probable problem is: the account you use to log-in with CAML builder is not the same (i.e. has not the same permissions) than the one you run your custom code with.
For instance, if one account has R/W permissions while the other one is only a reader, non-published article (drafts) are not visible for the reader.

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.