I am facing an issue with "Yes / No Checkbox" field while fetching results from CAML Query.
I have created one sitecolumn with "Yes / No" checkbox type & added the same to a list, now I am using the below code in CAML Designer to fetch the selected checkbox items.
<Where>
<Eq>
<FieldRef Name='Selected' />
<Value Type='Integer'>1</Value>
</Eq>
</Where>
(OR)
<Where>
<Eq>
<FieldRef Name='Selected' />
<Value Type='Boolean'>True</Value>
</Eq>
</Where>
In the both cases I am failing to fetch the selected items.
Can any one of you help me on this issue?
Let me know if you have any queries.
Regards,
SPUser.
<Where> <Eq> <FieldRef Name='Selected' /> <Value Type='Boolean'>1</Value> </Eq> </Where>
Hi,
Thanks a lot for your response. I have tried this option also, but no luck...:(
Please suggest.
Regards,
SPuser.
Ohh....I am wrong, the code was working fine(Posted by me & You), Only mistake was that clicking on "Test" button instead of clicking on "Execute" button.
Thanks,
SPUser.
Hi
Can you try the below code
<Where> <Eq> <FieldRef Name='Selected' /> <Value Type='Text'>Yes</Value> </Eq> </Where> (or) <Where> <Eq> <FieldRef Name='Selected' /> <Value Type='MultiChoice'>Yes</Value> </Eq> </Where>
Thanks
Sowmiya
Hi,
I'm guessing you're having an issue not with the query itself. When you don't know how your query should look like you can always create one via UI by modifying view filter. Least for me it shows this and it works just fine:
<Where> <Eq> <FieldRef Name="RequiresReply" /> <Value Type="Boolean">1</Value> </Eq> </Where>
FYI. In SP2013 (15.0.4675.1000), only this worked for me:
<Eq><FieldRef Name='IsIndexed'/><Value Type='Bool'>0</Value></Eq>
When CAML querying in PowerShell for "No" in my Yes/No field "IsIndexed".
Neither of these worked:
<Eq><FieldRef Name='IsIndexed'/><Value Type='Boolean'>0</Value></Eq>
<Eq><FieldRef Name='IsIndexed'/><Value Type='Integer'>0</Value></Eq>