Promote XML Nodes to Columns in Form Library

Need to automatically promote the properties (nodes) of an XML document in a Form Library using a properties.xfp file? 

This can be accomplished by publishing an InfoPath form to a Form Library as well; however, these steps walk through a similar solution if you are not using InfoPath.

 

  1. Create a form library named "Books" in SharePoint (UI)
  2. Using SharePoint Designer, expand the "Books" node and create an XML file "Properties.xfp" in the "Forms" folder.
  3. Inside the Properties.xfp, add the following XML (CASE SENSITIVE):

 

<Fields FormAggregation="true">

<Field Type="Text" DisplayName="ISBN" Name="ISBN" Node="Book/ISBN" />

<Field Type="Text" DisplayName="Title" Name="Title" Node="Book/Title" />

<Field Type="Text" DisplayName="Last Name" Name="LastName" Node="Book/Author/LastName" />

<Field Type="Text" DisplayName="First Name" Name="FirstName" Node="Book/Author/FirstName" />

</Fields>

 

  1. Save the Properties.xfp file
  2. Open up your favorite XML editor (I like Notepad or EditPlus2)
  3. Create a new XML file: "0735622825.xml"
  4. Inside the new "0735622825.xml" file, add the following XML:

 

<?xml version="1.0" encoding="UTF-16"?>

<Book>

<ISBN>0735622825</ISBN>

<Title>Microsoft Office SharePoint 2007 Administrator's Companion</Title>

<Author>

<LastName>English</LastName>

<FirstName>Bill</FirstName>

</Author>

</Book>

 

  1. In SharePoint (UI), browse to the Books form library that you created earlier
  2. Upload the new XML file you just created
  3. Done!  You should see the new XML in for the form library with SharePoint automatically creating and promoting the fields into columns of the list.

Leave a Reply


Promote XML Nodes to Columns in Form Library

Need to automatically promote the properties (nodes) of an XML document in a Form Library using a properties.xfp file? 

This can be accomplished by publishing an InfoPath form to a Form Library as well; however, these steps walk through a similar solution if you are not using InfoPath.

 

  1. Create a form library named "Books" in SharePoint (UI)
  2. Using SharePoint Designer, expand the "Books" node and create an XML file "Properties.xfp" in the "Forms" folder.
  3. Inside the Properties.xfp, add the following XML (CASE SENSITIVE):

 

<Fields FormAggregation="true">

<Field Type="Text" DisplayName="ISBN" Name="ISBN" Node="Book/ISBN" />

<Field Type="Text" DisplayName="Title" Name="Title" Node="Book/Title" />

<Field Type="Text" DisplayName="Last Name" Name="LastName" Node="Book/Author/LastName" />

<Field Type="Text" DisplayName="First Name" Name="FirstName" Node="Book/Author/FirstName" />

</Fields>

 

  1. Save the Properties.xfp file
  2. Open up your favorite XML editor (I like Notepad or EditPlus2)
  3. Create a new XML file: "0735622825.xml"
  4. Inside the new "0735622825.xml" file, add the following XML:

 

<?xml version="1.0" encoding="UTF-16"?>

<Book>

<ISBN>0735622825</ISBN>

<Title>Microsoft Office SharePoint 2007 Administrator's Companion</Title>

<Author>

<LastName>English</LastName>

<FirstName>Bill</FirstName>

</Author>

</Book>

 

  1. In SharePoint (UI), browse to the Books form library that you created earlier
  2. Upload the new XML file you just created
  3. Done!  You should see the new XML in for the form library with SharePoint automatically creating and promoting the fields into columns of the list.

Leave a Reply