Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When I access a document through the Lists.GetListItems web service, I get meta data in the ows_* attributes. These, however are encoded in a strange way ("[RowID];#[data]"). I'm fairly confident I can parse these reliably, but is there a less opaque way to extract document meta data? Is this encoding format documented somewhere?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

When using the WebServices SharePoint gives you the "full" value of Lookup fields as it don't know if you just want the text or also the relation.

The format is described in the remarks to SPFieldLookupValueCollection.ToString Method as

The string that is returned includes a series of substrings, each of which represents one value for a multiple value lookup. The substring for a single value has the following format:
Id;#Value

In this format, Id is the identifier for the list item that the lookup field points to and Value is the value of the field that the lookup field points to. The two parts are delimited by the characters ";#". If Value contains a semicolon (";"), it is escaped with a semicolon (";;").

The same delimiter (";#") is used when multiple values are joined in a single string such as the one returned by the ToString method. For example, the following string represents the value of a multiple value lookup with two values:
3;#a field value;#7;#another field value

The only thing to look out for is the ;; being an escaped ; in the text

share|improve this answer
    
Thanks. I can add that I found <ViewFields Properties="True" /> to be very helpful in this regard. –  mseebach Jul 30 '12 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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