filterCAML converted to filterREST

Home Forums Autocomplete filterCAML converted to filterREST

Viewing 2 reply threads
  • Author
    Posts
    • #33386
      MikeS
      Participant

        Alexander,

        I’d like to transition a CAML filter to a filterREST (for speed reasons) but am having problems with the syntax.

        CAML example of multiple OR statements:

        <Where><In><FieldRef Name='Field1'/><Values><Value Type = 'Text'>Draft</Value><Value Type = 'Text'>In Work</Value><Value Type = 'Text'>Completed</Value></Values><In></Where>

        How could that be expressed as a filterREST statement while also adding an AND to the three OR statements? For example, if Field2 = “No” AND (Field 1 = Draft OR Field 1 = In Work OR Field 1 = Completed)?

        Thanks for your help.
        MikeS

      • #33393
        Alexander Bautz
        Keymaster

          Try it like this:

          Field2 eq 'No' and (Field1 eq 'Draft' or Field1 eq 'In Work' or Field1 eq 'Completed')

          If Field2 is boolean you must write it like this:

          Field2 eq 0 and (Field1 eq 'Draft' or Field1 eq 'In Work' or Field1 eq 'Completed')

          Alexander

        • #33406
          MikeS
          Participant

            Works great. Thanks!

            MikeS

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.