Monday 25 July 2011

Using InfoPath Data in SharePoint Lists

When submitting an InfoPath for to a SharePoint list, the data from the IP form can be used to to populate values in the document list or other lists on the SharePoint site.
Here are the steps.

InfoPath

After the IP form is complete, the fields that are to be exposed to SharePoint need to be promoted as properties. 
1. Select the Form Options selection from the Tools menu
2. Select the Property Promotion option on the left side of the Form Options Dialog
clip_image002
3. Click the Add button to add a field to the list
clip_image004
a. The Select a Field or Group dialog box will show all of the fields used in the IP form.
b. Select the field you want to make available to SharePoint
c. Update the Column Name to the name you want to show in SharePoint
HEY! This name does NOT need to be the same as the field name you selected from the list. IP/SharePoint keep a reference to the field, not the pushing name.
HEY! When you select the field from the list, IP will attempt to create a user friendly name for the field. The result of this is the addition of spaces added to the name. Sometimes this makes sense, not often. So make sure you check the name before you click OK.
 
d. Click OK
e. Repeat this for all of the fields you want to be available in SharePoint
clip_image006
4. Publish the form to SharePoint

SharePoint

In the list used to store the data from the IP document (this can be the same list used to store the IP document or a different list altogether), create new column(s) to store the data.
1. Select the List Settings option from the Setting menu option
clip_image008
2. Under the Columns group, select Create Column
3. Enter the data for the new column: Name, Type, Description, etc…
4. Click OK
5. Repeat steps 2-4 as necessary to add all of the columns needed

SharePoint Designer

After the IP form has been completed and submitted to SharePoint and the workflow is started, the fields that where promoted will be available to the work flow.
This example is based on a custom work flow in SharePoint Designer


To reference the fields from the Conditions logic section:

1. Utilize the first condition block or add a new one
2. Select the “Compare <Your List Name Here > field” option
clip_image010
3. Select the Field label on the new condition description
clip_image012
4. The promoted fields, along with all other list fields, will show in the list
5. Select the field you want to test
6. Select the Value label
7. Enter or select the appropriate value for the conditional test
clip_image014


To use the promoted fields to populate the current list:

1. Create a new Action
2. Select the Update List Item option
clip_image016
HEY! The order of items in this list is dynamic. Items will not always show in this order. The order of the items is based on the last one used.
3. Leave the List selection as Current Item
4. In the Update List Item dialog box click the Add button
    a. From the Set this field dropdown, select the field (column) to update
    b. Select the clip_image018 (function) button next to the To this value box
          i. Leave the Source field as Current Item
          ii. From the field dropdown, select the promoted field to use
          iii. Click OK
     c. Click OK
     clip_image020
     d. Repeat for each column that is to be updated with the IP form data
5. Click OK


To use the promoted fields to create a new list item in a different list:

1. Add a new Action
2. Select the Create List Item option
clip_image022
3. Select the this list option
4. From the List dropdown, select the list to use
HEY! After the list is selected, the Field/Value list will show all of the required fields (columns) for the list
5. In the Create New List Item dialog box click the Add button
     a. From the Set this field dropdown, select the field (column) to update
     b. Select the clip_image018[1] (function) button to the right of the To this value box
          i. Leave the Source field as Current Item
          ii. From the field dropdown, select the promoted field to use
          iii. Click OK
     c. Click OK
     d. Repeat for each column you want to update with the IP form data
6. Click OK
To use the promoted fields to update an existing list item in a different list
1. Create a new Action
2. Select the Update List Item option
clip_image024
3. Select the this list option
4. From the List dropdown, select the list to use
5. In the Create New List Item dialog box click the Add button
     a. From the Set this field dropdown, select the field (column) to update
     b. Select the clip_image018[2] (function) button to the right of the “To this value” box
          i. Leave the “Source” field as Current Item
          ii. From the field dropdown, select the promoted field you want to use
          iii. Click OK
     c. Click OK
     d. Repeat for each column you want to update with the IP form data
6. Select the appropriate list item to update
     a. From the Fields dropdown (at the bottom of the dialog), select the field to use as a unique reference for the item to be updated
     b. Enter the value to be used as the key to identify the list item to be updated. (if the data is stored as a work flow variable or a promoted field, use theclip_image018[3] (function) button to reference that data)
     clip_image026
7. Click OK

Source: http://cycogeek.fiesta25.com/blogs/cycogeek/post/2008/10/10/Using-InfoPath-Data-in-SharePoint-Lists.aspx 

No comments:

Post a Comment