SmartForm to InfoPath HELP

  • 19 December 2005
  • 5 replies
  • 0 views

Badge +3
Simple question. I have a an InfoPath process and I want to add an Activity to that process that will use a SmartForm. When I create the SmartForm I add a textbox to the SmartForm and then go to bind to a process level field in the K2 process. Under the XML Fields node in the tree all I see is K2InfoPathSchema. I see nothing else under it.

This schema is a supposely process level data, so how come I am not seeing these elements?

Please help.
Jason

5 replies

Badge +8
Hi Jason

When setting an XML datafield as the source for a K2Textbox, you also have to specify the XPath to the XML element you want to display.

Once you have selected the K2InfoPathSchema XML datafield in the 'Datafield' property of the textbox, click on the DataXPath property and either type in the XPath or use the ... button to browse to the element that the textbox should be mapped to.
Badge +3
Ok. That helped. Now I have my next problem. I am trying to do a process where a user will do a submit in ASP.net but then another group of users will access the data in an InfoPath form.

So, I am able to submit data via a SmartForm and bind the controls using the InfoPath schema. I was hoping that then data would be visible inside of InfoPath.

Here is my new error. When I open up the InfoPath form in the desitnation user's worklist, I get the following error:

Element '{http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-12-09T10:03:59}_K2' is unexpected according to content model of parent element '{http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-12-09T10:03:59}myFields'.

Any thoughts on how to overcome???
Badge +8
From this thread: http://forum.k2workflow.com/viewtopic.php?t=896

Comment:

There was a mistake in the name of the sharepoint library for the infopath documents. So the two documents schemas of the request and approval were different.
After changing the name it worked


If you used the InfoPath process template to K2-Enable the InfoPath form, you could also try to kick off a process instance using the InfoPath form. Then compare the data in the K2InfoPathSchema XML datafield between the process started by the InfoPath form and the process started by the ASP.NET form to ensure that the content of the XML datafield is correct when using the ASP.NET form to start the process.
Badge +3
Thanks, I will give that a try. I saw that posting but I did not infer what you are suggesting. From what it sounds, if I am starting an InfoPath process with a SmartForm I have to ensure that the K2 node that gets pushed into the InfoPath schema is properly set with default values. Correct???
Badge +8
I have to ensure that the K2 node that gets pushed into the InfoPath schema is properly set with default values

Yes, that is what I meant.

Reply