I'm attempting to query for list items using a value stored in a plain text multi-line of text field in a SharePoint 2007 custom list.
My column is named FilePath and contains a value like: /admin/SiteCollection/Report Library/Reports/Corporate Reports/Final Audit Report [Dec-11].pdf
I would like to create a CAML query that will return this item. For example:
<Where><Eq><FieldRef Name="FilePath" /><Value Type="Text" >/admin/SiteCollection/Report Library/Reports/Corporate Reports/Final Audit Report [Dec-11].pdf</Value></Eq></Where>
Problem is... it doesn't work. We have seemingly narrowed it down to an issue with the square brackets. Duplicating the row and removing the square brackets lets us query for the item again.
How can I query for items using a multi-line of text file which contains square brackets?
Some more research:
- Seems to work OK when a single line of text field contains square brackets
- Using BeginsWith works ok:
<Where><BeginsWith><FieldRef Name="FilePath" /><Value Type="Text" >/admin/SiteCollection/Report Library/Reports/Corporate Reports/Final Audit Report [Dec-11].pdf</Value></BeginsWith></Where>
- Using Contains works ok:
<Where><Contains><FieldRef Name="FilePath" /><Value Type="Text" >/admin/SiteCollection/Report Library/Reports/Corporate Reports/Final Audit Report [Dec-11].pdf</Value></Contains></Where>
- I've tried encoding the square brackets (
[Dec-11]
) and using<![CDATA[]]>
, both of which work in other queries, but do not help here.
Contains
works fine...