8

I have a list with an URL-field. Nothing special, just the OOTB Hyperlink-field.

I want to execute a CAML-query that selects items with a certain value in the description part of the URL-field.

CAML

<Query>
  <Where>
    <Contains>
      <FieldRef Name="URL" />
      <Value Type="URL">text</Value>
    </Contains>
  </Where>
</Query>

Result Only items with 'text' in de url part are selected, if a item has 'text' in the description part it is not selected.

How do i select items based the description of the URL?

1 Answer 1

8

I'm pretty sure you won't be able to do this with a CAML query. This is because for 'complex' fields which store multiple values, only the 'default' value is available to query - by this I mean what would be available when SPField.GetFieldValueAsText() is called.

This would mean the only way to 'query' like this is to iterate through the items in the list.

2
  • 1
    Thanks, for now i just added an extra column which duplicates the value of the description and use that for filtering.
    – Dribbel
    Commented Feb 21, 2010 at 11:24
  • If this is the solution. It will take more time to show the Results..
    – user9008
    Commented Jun 21, 2012 at 13:39

Your Answer

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

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