1

I have a column with an internal name of: PublicY with 2 choices: Yes/No, the query works but if I change the choice name to Ja/Nej the code will not query the results, why? I have tried to change the code to Ja/Nej also

        <Eq>";
        <FieldRef Name='PublicY' />";                           
        <Value Type='Choice'>YES</Value>";
        </Eq>";

1 Answer 1

0

If you use a choice field with two values "Ja" and "Nej", the query

<Where>
  <Eq>
    <FieldRef Name='PublicY' />                           
    <Value Type='Choice'>Ja</Value>
  </Eq>
</Where>

should work. Or you can use a boolean field instead, then there's a checkbox in user interface, and the query would be

<Where>
  <Eq>
    <FieldRef Name='PublicY' />                           
    <Value Type='Boolean'>1</Value>
  </Eq>
</Where>
2
  • I have tryied with your first option its not working, i have removed all the content type and built it again and its not working
    – kalle
    Mar 21, 2014 at 12:14
  • @Gintas is right in his 2nd option. Use boolean(Yes/No) instead of choice.
    – Unnie
    Mar 21, 2014 at 12:41

Your Answer

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

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