Property promotion/demotion between file and columns in SharePoint – Part 1

Property promotion/demotion is a process that promotes/demotes data stored in document (or file) into columns in the SharePoint document library; some would call it a synchronization process. Anyway, it is quite convenient to have that sort of copying back and forward between file and column whenever a value changes in either of them.
More on the process can be read here:
http://msdn.microsoft.com/en-us/library/aa543590.aspx
http://www.sharepointblogs.com/erickraus/archive/2007/05/18/promote-xml-node-properties-in-form-library.aspx

In this first post I´m going to use the method described by Eric Kraus (in the link above) that uses SharePoint Designer to accomplish this.

 

  1. Create an instance of a Form Library through the UI. (I call mine Books)
  2. Open SPD and add a file called Properties.xfp to Books/Forms
  3. Add the following content to the file and save it.
  4. <?xml version="1.0" encoding="utf-8" ?>
    <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" />
        <Field Type="DateTime" DisplayName="Published" Name="Published" Node="Book/Published" />
    </Fields>
    
  5. Through the UI, navigate to your library and add/upload a new file. The content should look something like:
  6. <?xml version="1.0" encoding="UTF-8"?>
    <Book>
    <ISBN>0735622825</ISBN>
    <Title>Microsoft Office SharePoint 2007 Administrator's Companion</Title>
    <Author>
        <LastName>English</LastName>
        <FirstName>Bill</FirstName>
    </Author>
    <Published></Published>
    </Book>
    
  7. Try modifying the xml directly and through the editform.aspx and see the promotion/demotion between them.

 

 

 

 

Summary: This works great if you first create the library and then modify it through SPD. If you would like to use a feature, this method won´t work. My next post will deal with that.

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: