This situation is not far out but is a conundrum...

I am using GetListItems to query a SharePoint 2010 list. My restrictions on the list are:

  • return back only a few select fields (on top of the the default core columns that can't be helped)

  • break up the ows_metadata field so the contents are treated as normal attributes instead of having to parse with a yucky regex.

It seems that I can do one OR the other, but not both. Either the ViewField must be empty and the ViewFields attribute Properties=TRUE, or the view field is specified and the ows_metadata field comes back as one big chunk. Is there a way to have both work?

What I want:

<z:row ows_fieldIActuallyWant="xyzzy" ows_MetaInfo_column1="foo" ows_MetaInfo_column2="bar" ows_MetaInfo_column3="bat"  ...[additional mandatory fields]... />

What I actually get (in both cases ViewFields attribute Properties="True"):

If the viewfield is left blank:

<z:row ows_MetaInfo_column1="foo" ows_MetaInfo_column2="bar" ows_MetaInfo_column3="bat"  ...[***ALL*** other fields]... />

or if viewfield is specified:

<z:row ows_fieldIActuallyWant="xyzzy" ows_MetaInfo="1;#column1|foo ows_MetaInfo_column2|bar ows_MetaInfo_column3|bat..."  ...[additional mandatory fields]... />

Is there a reason these 2 don't play well with each other?


(I'm going to go ahead and be a capricious jerk and answer my own question before anyone else gets a chance.)

I need to have both the property set to true, and a Field ref to MetaInfo to see the MetaInfo field broken up and still filter out extranious other fields. Like this:

<ViewFields Properties="True"> <FieldRef Name='MetaInfo' /> </ViewFields>

Hope it helps someone else.


Lol good answer! Placing these items in your call filter returns a more sorted and distinct view. Also reduces overhead

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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