Skip to main content

Pals,


How can I store InfoPath Repeating table data into SmarObject? When i try to save it it only saves first row of the table. How to loop through and save all the data into smart object?

This is one of the most annoying limitations with InfoPath... bottom line is, you can't do it inherently in InfoPath, you have to either do it in code (not fun in InfoPath) or handle it in your K2 process.  To handle it in your K2 process, after your form is submitted you can have an activity that iterates through each item in your repeating section of the InfoPath form (the InfoPath source is stored as an XML field that you can reference in the destination rule of your activity).  Create a server code event for each one that parses the actual values out, and then send them along to a SmartObject call.  As usual, I am vague as hell, but I hope to point you in the right direction.  This blog post may help:


http://blogs.claritycon.com/blogs/tim_byrne/archive/2008/04/17/stumbling-through-k2-blackpearl-for-each-loop-simulation.aspx


I've solved a similar problem in InfoPath without code by using the posts from the following thread (specially the codeless method mentioned in Johnny's post)


http://www.k2underground.com/forums/permalink/24729/25092/ShowThread.aspx#25092


 The steps are a bit convoluted but it worked for me.


Regards,


Tim


Wow, that is a pretty clever approach!  Not sure how maintainable that is, but it is another option and it would keep your K2 processes a bit cleaner.  Ultimately, it looks like you have a choice.

Reply