I am trying to create a Data Source in SharePoint Designer that connects to a SharePoint List via XML Web Services. I have created the Data Source and connected to the list in question. I can view all the data using GetListItems, and I want to filter it using the query parameter.
The query parameter takes an XmlNode, and when I put this as the value I get an error:
<Query>
<Where>
<Eq>
<FieldRef Name="Title" />
<Value Type="Text">Foo</Value>
</Eq>
</Where>
</Query>
Of course, I have not entered any tabs or newlines, as I only have a one-line entry field in SharePoint Designer. I receive an error with this query:
The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator.
I simply want to filter the list items resultset to be those with the Title field of "Foo". Can this be done in SharePoint Designer?
Update: escaping the < and > in this manner also fails:
<Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">Foo</Value></Eq></Where></Query>
Update: This appears to be a known issue with SoapDataSource components and SOAP calls. Apparently, they are over-encoding the <'s and >'s before they get submitted. The workaround given is to save the data source without a query parameter, and then to add it to the page and create a filter in the Common Data View Tasks dialog. I was able to get this to work using the following filter string:
[@ows_Title = 'Foo']
Unfortunately, this doesn't help me much as I am adding a Data View (showing the data) rather than a DataSource that I can use to point other controls to (like a drop-down list).
I'm still looking for a good solution on this that lets me place a datasource using SharePoint Designer.