Infopath forms in SharePoint - take care when changing field properties

InfoPath logo

Infopath forms in SharePoint are great. We love them and make extensive use of them for Quanta internal processes.

But for the developer they can sometimes be a bit of a pain (anyone for XPath, for example) and sometimes the pain comes from unexpected directions.

In this case, we have a simple data field holding a text value. The form control is a combo box, which gets its values from a data connection to another SharePoint list. The form has been in use for a while and our library has quite a few documents in it.

The requirement now changes so that instead of a single value this field now needs to allow multiple values to be selected. Should be easy enough - we just change the data field to a repeating value by ticking the box on the Field Properties dialog.

Infopath gives us a warning on the form control saying "Control cannot store this data type" (which probably should have sound enough alarm bells really, but that's easy to spot with hindsight) so we change the control to a repeating table and all looks good. We also need to add a date field to associate with each selection so we create a new group and move the text and date fields into it.

Having made a few other changes to the form we then publish it to the library and move on.

And then we find out just what we've done. Because we've changed the field type Infopath has removed it from the list of fields promoted to the SharePoint library (a repeating field has a number of choices to be made about how the data will be put into a SharePoint column) and as a result the data stored for this column has gone. Lost, vanished, irretrievable.

Whoops.

In this case it wasn't a huge problem - the library only contained about thirty completed forms, and the developer was able to persuade the SharePoint admin to restore a copy of the library from the backup so the lost data could be copied and pasted back in - so we got away lightly with some valuable lessons learned.

  • When updating Infopath data fields, always check they are still selected to be promoted to SharePoint.
  • Use the test setup first before publishing to a live library.
  • If you haven't got a test server, export the library first as a backup.