Out Of The Box Sharepoint (?)

May 31, 2011

Infopath-fields and custom list-columns

Filed under: Infopath, Sharepoint — Peter Kruisman @ 3:25 pm

We use infopath forms in organizational processes.  One of such is part of a Sharepoint workflow. The data gathered by the workflow tasks is added to the form library.

In red the columns that are populated by the tasks

The requirement is that printing this form the additional tasks data has to be included. For this I copied the form layout and fields to a newly added form print view. In this view I added the additional fields that represents the data gathered by the tasks. After defining a data connection that includes all list columns and checking the checkbox “Include Data for the Active Form only” I matched the newly added infopath fields with the corresponding list columns.
Testing this the fields where not populated with the data. I stumbled across this posting about white spaces in the forms file name causing a failed data connection with non infopath list columns. This was not the case with our list names. Although testing this using the concat() field formula with a combination of  infopath and non-infopath listcolumns,  

In the red boxes the non-infopath list columns
The meeting title is the forms name

non-infopath fields are indeed empty if spaces were used in the forms file name:


Using a file name without spaces:


Now all referenced fields produce data.

The bonus of this test is that I discovered that using a formula solved my problem: I have now gathered non infopath data into my form.
For this to work make sure that the formula includes an infopath form field. If it only includes non-infopath fields it doesn’t gather the data.
My solution is to add a hidden empty dummy field to the infopath form and reference this in the formula, for example:
concat(@id; dummy) <- @id is the item id (non-infopath) dummy is the hidden empty infopath field.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Blog at WordPress.com.

%d bloggers like this: