Fields Element

The Fields element is used both in defining a list (to specify the fields that are implemented) and in rendering the list for the browser. When used inside a view, it iterates over the view fields. When used outside a view, it iterates over all the non-hidden fields in the list.

Syntax

<Fields>
</Fields>
Parent Elements Child Elements
ListFormBody, MetaData, ViewBody, ViewEmpty, ViewHeader, XML Field, HTML, Property, RenderPattern, ScriptQuote, Switch

Remarks

Use of the <Fields> tag is synonymous with specifying <ForEach Select="Fields/Field">.

Example

This example,

<ows:XML>
  <SetList Name="Announcements"/>
  <Fields>
    <Property Select="Name"/>
    <HTML><![CDATA[ is the internal name for ]]></HTML>
    <Property Select="DisplayName"/>
    <HTML><![CDATA[<br>]]></HTML>
  </Fields>
</ows:XML>

renders the names of fields used within the Announcements list as follows:

ID is the internal name for ID. Title is the internal name for Title. Modified is the internal name for Modified. Created is the internal name for Created. Author is the internal name for Created By. Editor is the internal name for Modified By. Edit is the internal name for Edit. LinkTitle is the internal name for Title. Body is the internal name for Body. Expires is the internal name for Expires.