Skip to main content

Hi,


 I am very new to K2 and Infopath
 I really need some help on K2 Blackpoint SmartObjects Repeating Table infopath.


 This is the scenario:


 I have an infopath form that has a repeating table with values pulled from a SharePoint List.
 The values of the repeating tables need to be changed and only populated back to another Sharepoint
 List after it completed the entire workflow.


 I am thinking of using Smart Object to help me store the values inside form during the routing process (not sure if I am right)


 So what I have done so far
  
  1. I create a Smart Object on the sharepoint list
  2. I create a secondary datasource on my infopath form and drag the datasource as an repeating table on the form.
  3. I change one of the fields to a dropdown list which take the drop down value from another list.


 But I do not know how to save the change in value when the user select another value in the dropdown list of the repeating table
 back to the Smart Object. Please advice.

Hi Alex,


This is definately possible using the Update method on the smartobject.  Basically what you need to do is add a column to your repeating table with an "update" button that the user can click to update each list item individually.  With Infopath there is not really an easy way to do a "for each" loop so as to setup a batch update for repeating items.  The rule behind the button will need to copy all the metadata for that list item  into the input paramaters for the update method secondary data source and then query the update datasouce to make the call and update the list item. 


I hope this helps


Eric


 


Hi Eric,


       Thank you so much! This is very helpful.


          Can I also check with you on a few things regarding updates?


        1. When I integrate the update method into the infopath form, it appear at the secondary datasource of Infopath form. Inside the infopath form, it is indicated as type 'Retrieve Data'. Did I configure wrongly? Secondly, I have read in forums that there is a need to configure the input parameters. I tried using the SmartObject Getlist fields(the field which is updated) set it as the value for SmartObject update input fields. Apparently, it is worng. Is there any references which you have seen on configurating the update method for Smart Object on infopath?


        2. Another way I have thought is to use Smart Object events to do the updating but once my form submits, the modified value of the smart objects is  no longer there. Is there any way to retain the modified values of the Smart Object  repeating table?


        Thank you so much again.


Best Regards


Alex


 


 


         


Hi Alex,


Sorry for the delay I have been traveling.


The type for the method is correct, basically all smo methods will show that way as they both send and receive data. 


The reason you are not having success is that the update method is not a bulk update so it will need to be called per item which means having a button in the repeating table (for each row) which then passes the Get List return properties to the Update Query properties.  Because the rule is for a button that is in the repeating table it will pass the get list values for the row that the button is on.   You need to make sure to also pass the ID field to the update query properties or else the update will not work.  After the fields are mapped then you call the update query method to do the update.


I have attached an example form which has this setup.  Obviously my smartobject connections will not work in your environment but you should be able to look at the rules to find out what I am doing.


To answer your other question you cannot wait until the process because the secondary datasources are not persisted in the form.  They live in memory on the client machine.  Only the Main datasource contains data during the submit process.


I hope this helps.


Eric


Hi Eric,


You have been most helpful. You have confirmed those doubts that I have. Thanks once again!


Best Regards


Alex Lee


Reply