Create the Main Workflow – 2 of 4

In my previous blog post, I described what I wanted to do and some configuration steps.

Now I am ready to create the workflow that will migrate content. I create the workflow in the document library containing the InfoPath documents.

FormTrek13

I select a blank workflow template and click Create.

FormTrek14

Next I create workflow variables for each field.

FormTrek15

The workflow variables appear below. I use the letter “t” in front of each field name.

Note that the last variable is new and named tProjectID. It is a List Item ID type.

FormTrek16.jpg

I click Close to close the Workflow Variables screen.

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

FormTrek17

This is the first action in the workflow.

FormTrek18

I configure the workflow action. The XML source should remain set to the Current Item. Process using XPath.

FormTrek19

Click on XPath Builder.

FormTrek21.jpg

I copy and paste the XML that I displayed earlier.

FormTrek22

Then I click on Tree View and select my:ProjectName.

FormTrek23

Then click on Apply.

The Query XML screen is displayed and I select Store result in tProjectName. tProjectName is one of the workflow variables that I created earlier.

FormTrek24

I click on FormTrek25.jpg and repeat the process for the remaining form fields on the main Project form.

Now we need to save the values to a new list item. Select Create item from Libraries and lists.

FormTrek26

Create the item in the Project Main custom list. Set the content type to Item. Store the new item ID in tProjectID. I will reference the value in tProjectID later when I create the Task Detail items. Then add all of the main fields as seen below. You have to pick them one by one from the Field drop down list.

FormTrek27

Note that I set the return type for tProjectOwner and tDescription to be Plain Text.

FormTrek28

Click Save to save the Create item action configuration.

We need to save the ID value to the Project ID field in the new list item. Select Update item from Libraries and lists.

FormTrek29.jpg

I want to update the new item that I just created in the Project Main custom list. I select Project Main from the Update drop down list. I select ID in the Where drop down list. I set Equals to Workflow Data and the tProject ID. It seems silly; but I am looking up the item that I just created using the Project ID value that I stored in the Workflow variables.

Next I set the Project ID on the new item to be equal to the tProjectID value stored in the Workflow variable.

I believe that the reason why I have to do this is because the ID value is not initialized and saved to the Workflow variable named tProjectID until the new item is saved. Thus, I need to go back a second time to the item to save the item’s ID value to the Project ID field.

FormTrek30

I save the Update item configuration.

Click Save to save the Query XML configuration. Set the Title and Description (optional).

FormTrek31.jpg

Click Submit.

FormTrek32.jpg

Click OK. The workflow is saved.

Next I need to add the Project details to the workflow. See my next blog posting for the details on how to do this.

3 thoughts on “Create the Main Workflow – 2 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