Add the Details to the Workflow – 3 of 4

In my previous blog post, I create the workflow to migrate the Project information from the main part of the form to a custom list. Now I repeat the process for the task details. If you recall, the task details are in a repeating section on the InfoPath form.

I create workflow variables for each field. This time each variable is create as a Collection Type. Then I repeat and create each variable as the correct data type; but with the letter “t” in front of the field name.

Finally, I add a workflow variable named TaskIndex and give it a Number type.

FormTrek33

I close the Workflow Variables screen.

Next I select the Workflow Action named Query XML in Integration.

The XML source should remain set to the Current Item. Process using XPath.

Click on XPath Builder.

I copy and paste the XML that I displayed earlier.

FormTrek34

Then I click on Tree View and select /my:myFields/my:group1/my:group2/my:TaskName.

Then select colTaskName in Store result in.

FormTrek35

Add the next two task fields.

FormTrek36

The text in each of the three repeating task fields will be saved in the collection variables.

Next, we need to loop through the values in the collection variables and store them in separate task detail items.

Add a For Each loop action below the second Query XML action.

Configure the For Each loop action so that the text in the task name collection is saved to the single task name. The target collection is the colTaskName. colTaskName contains the task names. Store the result in tTaskName. Use TaskIndex as the Index.

FormTrek37

I need to repeat this for Task Description and Task Owner. I add a Run parallel actions workflow action below the For each loop action.

FormTrek38

The action should appear below the For each action. Two branch actions appear.

FormTrek39.jpg

Next, I create a Collection operation below each Branch action in the Run parallel actions. You can add more branches and collections for each field / variable that you have in your repeating section.

FormTrek40.jpg

I added two collection operations.

FormTrek41

Next, I configure the first collection operation for Task Details.

FormTrek42.jpg

Then I configure the second collection operation for Task Owner.

FormTrek43

Next I save the Task Detail values for each of the task details in the repeating section of the InfoPath document. I add a Create Item action below the Run parallel action.

FormTrek44

Configure the action to create the item in the Project Details custom list. Set the content type to Item. Add all of the detail fields as seen below. You have to pick them one by one from the Field drop down list.

Note that I add the ProjectID column and give it the value from the tProjectID variable. I also added the Project Name to the Title field.

FormTrek45.jpg

Note that I set the return type for tTaskDetails and tTaskOwner to be Plain Text.

FormTrek46.jpg

I enable the workflow to start from the item menu. I set this in Workflow Settings.

FormTrek47.jpg

Then I save and publish the workflow.

FormTrek48.jpg

Here is a view of the completed workflow.

FormTrek49.jpg

I close the workflow and return to the document library.

I select a document and click on the ellipsis.

FormTrek50.jpg

I click on the next ellipsis, and click on the Project workflow.

FormTrek51.jpg

I am taken to the Start Workflow screen.

FormTrek52

I click Start.

FormTrek53

The main Project document field values are saved to the Project Main list.

FormTrek54

The task detail fields of the Project document are saved as individual documents to the Project Details list.

FormTrek55

Next I need to transform the InfoPath form into a Nintex form. Then update the form to work with the main and detail lists. See my next blog posting for the details on how to do this.

2 thoughts on “Add the Details to the Workflow – 3 of 4”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s