Question

What I want to achieve : Take a keyword array as input and query Sharepoint List to return all rows which contain the keywords in the list.

I have built a simple CAML query to query my list with one keyword (pdf) .

<Query><Where><Contains><FieldRef Name='Keyword'/><Value Type='Text'>pdf</Value></Contains></Where></Query>

This works fine.

But, when I try to use Or clause in the CAML query(see below), I get the following error

"One or more field types are not installed properly. Go to the list settings page to delete these fields."

<Query><Where><Or><Contains><FieldRef Name='Keyword'/><Value Type='Text'>pdf</Value></Contains></Or></Where></Query>

I googled for the syntax and everything looks good. Please let me know what is missing.

Thanks in advance.

Was it helpful?

Solution

In CAML Query if you want to use OR you must and should have 2 conditions.

OTHER TIPS

The field reference name must be the internal name. You can find this by going to the colmn page in list/library settings and the name is the end of the URL. Spaces and underscores in the name must be handled differently.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top