1

.I am running below query against a sharepoint list.

How to check the results of below Camlquery? cPop is set with value 'AboutUs'.

Result is always zero records although list has valid matching records. Are there any tools that I can use to build & test queries?

                camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='RelateTo'/><Value Type='Choice'>" + cPop +
                        "</Value></Eq></Where><OrderBy Override='TRUE'><FieldRef Name='RelateTo'/></OrderBy><RowLimit>1</RowLimit></Query></View>";

3 Answers 3

1

You can try U2U Caml Builder. It isn't updated for SP 2010, but you can still connect via web services as seen here:

http://emmettlynch.wordpress.com/2011/03/28/sharepoint-2010-tool-bag-u2u-caml-query-builder/

Here's a link to the tool:

http://www.u2u.be/res/tools/camlquerybuilder.aspx

0

For 2010 there is the CAML designer on Karine Bosh's site:-

http://karinebosch.wordpress.com/my-articles/caml-designer/

3
  • I've never seen this before, but this is pretty cool. Frankly, I just write them by hand. Commented Jul 12, 2012 at 14:37
  • Yeah me too, they are fairly straight forward once you get used to them. Commented Jul 12, 2012 at 14:54
  • I'm going to send the link to our intern though. He could definitely benefit from the use of it. Commented Jul 12, 2012 at 14:57
0

Well your query seems to be correct, I would try removing "order by" condition since there is only one result you are checking. I would assume your items are in root folder. Hope it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.