Sunday, November 8, 2009

How to: Creating Infopath forms as content types and publish forms in SharePoint

Hi all,

InfoPath 2007 (electronic forms) and SharePoint 2007 fit together very well. However, developing an effective electronic forms solution has been quite challenging.

Issues with InfoPath 2003:

a) Difficult to develop data-driven solutions as the data was not sync with the data in the form.
b) Not easily published without changing the original form designer.

InfoPath 2007 overcame these issues:

a) Form templates can now be attached to content types and thereby we have power to redeploy the templates.
b) Form data fields are bidirectional and therefore developers can promote selected fields and have those fields presented as form library that end users can edit.

In this post, I will talk about a site collection, and few site.

Site-collection: http://comanyname/asia
Under this site collection I have to 2 sub-sites which are on the same level:

Site1: http://comanyname/asia/it
Site2: http://comanyname/asia/tools

Under site1, I also have a sub-site called as it/ITDocCenter where all IT documents are stored as templates (InfoPath templates).

http://comanyname/asia/it/ITDocCenter (sub-site of Site1)

I also have a Site2 (tools), where all IT department people will be filling out the InfoPath forms and these forms are based on templates which are stored in ITDocCenter.

Therefore, I needed content types in "tools" and refer these templates on "tools" sub-site.
I will step-by-step procedures:

1. We first design on InfoPath 2007 templates on local computer. Right click on InfoPath template and open the InfoPath template. On the toolbar, go to Tools >> Submit Options

2. On the "Submit Options" prompt,
>>Check the "Allow users to submit this form"
>>Select the "Send from data to a single destination"
>>From the drop down choose "SharePoint document library"
>> Click on "Add" button.

What we are doing here is that we are selecting a document library (System Checklists InfoPath) which will be on the "tools" sub-site. So, anyone you want to fill out an InfoPath form will be submitting that form to the "System Checklists InfoPath" document library.

3. On next screen, we define the full URL of that document library. (System Checklists InfoPath).

For the file name, I have used a formula which as some predefined conditions with today's date.

4. Final screen will give a summary of what we have selected. Click on OK button.

5. Go to "Design Tasks" >> "Design Checker" >> and check the "Design a form template that can be opened in a browser or InfoPath". Save the template now.

6. Go to "Design tasks" >> "Publish Form Template" >> Choose the first option.

In next screen, we have to enter the SharePoint site and in this case it will be http://comanyname/asia/tools

7. On this screen we will create a new content type. Select the "Create a new content type" and click "Next" button.

8. Type in the name of the content type.

9. This screen prompt us about where we want locate and save the form template. Clearly, we want store all our templates on the ITDocCenter site. In this case, I have stored into "Operations" document library.


10. Promote the selected fields. In my case, I chose "Time Period" and "Templates".

11. Next screen, will give is the summary and success of the content types.

12. Now, we go to the Tools site and go to "System Checklists InfoPath" document library.
Settings >> Form Settings >> Advanced Settings >> Allow content types.

13. Settings >> Content types >> Add from existing site content types >> Select with content types from >> Microsoft Office InfoPath >> Choose "Backup"

14. In the "System Checklists InfoPath" document library, we can see "Backup" as a new content type.

15. We fill-in the form

16. When we are done we submit the data to "System Checklists InfoPath" document library.

17. We can see a new record in "System Checklist InfoPath" document library. So, Tools >> "System Checklists InfoPath" everything is working fine. Lets check asia/it/ITDocCenter.

18. Surprisingly, there is no template on this document library. Reason: We have chosen "Document Library(Word Documents)" (Template ID : 101) where as "XML Form Library (InfoPath) (Template ID: 115). But we have a workaround.

19. We upload "Backup.xsn" from local computer to the SharePoint Server.

20. Now, we can see the a new record on the "Regional Infrastructure" document library. Now, if site administrator want to modify "Backup.xsn" file which is there in "Regional Infrastructure" document library, he could edit the InfoPath form >> Tools >> Design the form.

21. Add new questions and save it.

22. He has to republish the form template, promote the selected columns.

23. Finally, modifed InfoPath template has been changed.

24. Now, if we go to "Tools" subsite >> go to "System Checklists InfoPath" >> New >> Backup, then we can see the new questions in InfoPath form.


No comments:

How to: Use cascading drop-down lists in PowerApps

Hi all, Using cascading dropdown, users can easily fill the forms by selecting drop-down values dependent on values from another dro...