Translate

Thursday, July 16, 2015

Build a Table of InfoPath Repeating Section and Send Email using Nintex Workflow

If you have followed my previous post on how to read the Repeating Section data then this section would help you. On this post I will explain on how to form a table out the repeating section and build a string to Send an Email using Nintex Workflow.

1. Add a Build String activity after the Log to History activity. (Please have a look at my previous post here). This activity is added inside the For Each.

2. Create a multiple lines of text variable varStoreChargeCodes and form the table like above. Store the table result in varStoreChargeCodes
3. After the For Each activity, add another Build String activity, this will form the Email Body. We will use the varStoreChargeCodes variable, which is nothing but our table, containing the Project Names and corresponding Charge Codes.
4. You can add any detail you want to add on the build string, like for me I created a table to add the Employee Name, Employee Badge ID# and then added the variable containing Project Names and Charge Codes. Store the Email body is a variable varFormTable.
5. Finally add a Send Email activity like below, where the email body would contain the varFormTable variable.

That's it. The repeating section data would appear in a table. For me the email looks like below.


Happy Reading !







Read InfoPath Repeating Section Details using Nintex Workflow

Read InfoPath Repeating Section Details using Nintex Workflow

My InfoPath Form looks like below, where I have a repeating section which contains Project Name and Charge Code (Auto populated based on Project selection). The form is used by the PMs to request charge code for employees. After the form is submitted, Nintex Workflow has to execute and extract the values from the repeating section and send an email to coordinators. 

1. Add a Query XML activity and configure like below.
2. Create Two collection variables, one for Project and one for Charge Codes.
3. You can use XPath Builder to provide the field XPath or can copy it from the InfoPath field as well.
4. Add a ForEach activity and configure it like below.
5. Your target collection would be PrjNames and store the result in PrjName (a single line of text variable). PrjIndex is another number variable.
6. Add a Collection Action to extract the Project Names. Notice the target collection is PrjNames, GET, Index is PrjIndex and Storing the result in Single Line of text PrjName.
7. Similarly add another collection operation to get the Charge Codes
8. Add a Log to History activity to read the PrjName and ChargeCodeM field. 

That's it ! Your repeating section data is extracted.

I will talk about how to use these details, form a table and send an email on my next post.

Thanks !






Submit InfoPath Each Repeating Table Data to SharePoint List as Individual Item

Submit InfoPath Each Repeating Table Data to SharePoint List as Individual Item

I received a requirement to create a time card entry and keep track of the number of hours consumed in their activities. Below is a sample of the form.
I had to design the form in such a way so that individuals can make multiple entries for a week and on different types, like, Project, Holiday, if it is Project then What is the name of the project and whether it is Design or Lab hours. So, I added all my controls on a repeating section. Initially I thought of merging the records in comma separated value but reporting is complicated. I decided to save them in a list as individual item to make life easy. Below are the steps which can help you achieve the same.
1. Create a List and add all your fields which are required on the form.
2. Open the InfoPath Form designer, Select SharePoint List form template and Select Design Form.
    
3. Provide the Site URL
4. Select the List and continue
5. Now before you click finish, notice there is a check box says, "Manage multiple list items with this form".

6. Select the checkbox and click on finish.
7. This would open the Form with all controls added inside a repeating section.
8. If the repeating section is not enabled to add sections at run time, click on the repeating section property and enable them.

For me the end result look like below.



Hope this helps ! Feel free to suggest any other alternative you know.
Cheers !