Category Archives: InfoPath

Update InfoPath field in a Repeating Table with Nintex Workflow

How to update a column in a InfoPath repeating table based on the selected user in a other column?
I wanted to add several users to a repeating table and after submitting the form the computer, location etc. from the selected users needs to be added via a workflow in the form.

The structure of the form is as follows: we need the field AccountId that is a child from Person, which is a child from gpContactSelector, that is a child is from group4, which is a child from group 3 and finaly the parent is myFields.
The XPath for this field is:

/my:myFields/my:group3/my:group4/my:gpContactSelector/my:Person/my:AccountId

updaterepeatingtable2

 

The workflow has the following actions:

updaterepeatingtable3

 

Add a Query XML on the Current item and add the XPath path, store the results in a collection variable

updaterepeatingtable4

 

Add an for each action that process the collection and a text variable.

An Update XML
XML source is current item

Create the following Xpath query:

  • /my:myFields/my:group3/my:group4/my:gpContactSelector/my:Person/my:AccountId.  Go to the parent of the field AccountId 
  • [my:AccountId={Workflowvariable:Created Text variable}]
  • /parent::my:gpContactSelector/parent::my:group4/my:FromLocation. This tells the query to go up two levels to come to group 4 and select there FromLocation

Select Update node value
Add the variable you want to set in the FromLocation

updaterepeatingtable6

Just a last few point:

  • This workflow doens’t do anything more than retrieving and updating, other options you have to add yourself
  • For more XPath see http://www.w3schools.com/xpath/default.asp
  • To get the Query I used Altova XMLSpy

Add Cancel button to InfoPath form

When you look at the standard available options for buttons in InfoPath (Submit, Update form and Rules and Custom code)  you would think that there’s also an Cancel option by default.
There is no Cancel button by default, you can however create this within two minutes.

  1. Drag a new button on the form and select it.
  2. Select in the menu bar the tab CONTROL TOOLS PROPERTIES.image
  3. Rename Button to Cancel in the field Label.
  4. Click  Add Rule, a menu is shown. Select When This Button is Clicked, a new menu appairs. Select and Click Close Form. image
  5. Confirm that you want the form to be closed by clicking OKimage

And that’s it. You’ve created your own Cancel button within 2 minutes.