I get a 'Value does not fall within the expected range' error from the following CAML.

      <FieldRef Name="ID"/>
        <Value Type="Counter">5</Value>
        <Value Type="Counter">6</Value>

What am I doing wrong?

EDIT: I'm using a jQuery Library for SharePoint.

  • 1
    Can you please provide us with the section calling the CAML? Sep 27, 2013 at 8:22
  • Check out the EDIT of the question...
    – Denzo
    Sep 30, 2013 at 3:16

2 Answers 2


Although Microsoft added the clause to CAML in SP2010 I don't think they updated the SOAP WebServices api to support it.

See here: https://spservices.codeplex.com/discussions/457313


Try if Type="Integer" would work with ID when used inside <Values>. If not, convert <In> to multiple <Or> clauses. Workaround, yes, but internal ID field might be a bit special when used in CAML queries.

  • Type="Integer" made no difference. I'd like to avoid the workaround and try to understand what causes the issue.
    – Denzo
    Sep 30, 2013 at 3:21
  • 1
    You can always use decompiler to learn why it doesn't work, but a friendly advise: sometimes with SharePoint it's just better to move on if you want to get things done.
    – Jussi Palo
    Sep 30, 2013 at 8:09

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.