Skip to main content

Being new to infopath and K2.net I was going through article  Sharepoint Infopath and K2.Net Best practises:


The first recommended practise is as given below



1) Store InfoPath Data Externally
When using InfoPath processes, a good practice is to keep the data in the InfoPath form while it moves through the process. Then at the end of the process, shred the XML apart and insert it into a normalized database. As well, at various points in the process, push the XML document out to a different InfoPath form library where users can get access to the latest and greatest data.


 Can someone please guide me on how this is done. Do I save the form data from with infopath web forms or using the K2.net?


Btw, my infopath is basic HR forms with simple approval logic. I will needing to create reports on the form data later on.

There is lots of ways to save your infopath xml to the database. For me it is any to do this by making use of smart objects.


If you create a standard smart object it will create a database table for you in the smartbox database.  You can also make use of the dynamic sql service that can be found on the blackmarket on this site to create smart ojects that save data to any database of your choice.


As you know your Infopath XML data is stored as a xml field for your process. you can use this data and the smart object event wizard to save the xml data


After you created your smart object, you can make use of the smart object event wizard to save data to the database.


This data can then also be used for reports.


 


There are a few ways to do this and the complexity depends on how the form will be integrated.  First you need to decide if you will be using the full InfoPath client or Forms Server.  If you're using the fat client you can create the database in SQL and connect the form directly.  If you're using Forms Server then you will not be able to connect directly to the database.  If you decide to use Forms Server then you have a few options in the form of K2 SmartObjects to get the data into a database.  As Henk mentioned you can create a standard SmO which will create the tables for you in the SmartBox database or you can use the dynamic SQL Service to connect to existing DBs.


 One thing to note is that normally writing to the DB w/ SmartObjects only happens once the form is submitted so implementing repeating elements (which effectively require a separate table in the db) becomes a bit more difficult.  There are workarounds to get data from repeating tables written to the DB you'll just need to do a little searching on the forum here (It's on here somewhere).  The most important thing is to determine how users will interact with the form (full client or Forms Server) and mapping out the data.


Thanks for your suggestions Henk and Thrasher.


Thrasher,


I think, we would either go for form server or ASP.NET forms. Currently, we are more inclined to implementing the form server solution, as I understand it has better integration with K2.Net and Sharepoint.


I am planning to go the SmO way and am thinking about using the 'Dynamic Stored Procedure' service.


I was also trying to figure out how to implement a solution for repeating tables. I think I will have to dig deep this forum archives to find my answer.


Reply