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 !


Tuesday, April 7, 2015

Use SPServices in Nintex Form


Below are  the steps given to use famous jQuery SPServices in Nintex Forms

1. Open the minified SPServices file, in my case it is jquery.SPServices-2014.02.min.
2. Scroll down to the end of the file where you will see a line,
 
    return aK.test(ao(aM)[i.method](i.property))}})(jQuery);

3. Replace the term jQuery to NWF$
4. Save as the file in different name, NWF.min
5. Now upload the file to a SharePoint library and refer it in Nintex Form
6. Open Nintex Form settings, expand Advanced, and paste the url in "Custom Javascript Includes" section.
7. Expand Custom javascript and paste the below code.
   
           NWF$(document).ready(function(){
                 console.log(NWF$().SPServices.Version());
           });

8. Hit F12 and Preview the form.
9. If all the steps are followed, you can see the version of the SPServices file, in my case LOG: 2014.02 in the console.

Hope this helps. Cheers !

Wednesday, March 18, 2015

InfoPath Form Multiline Text published as Single Line of Text on Form Library

You have Multi line textbox on your InfoPath Form and after you published it, you noticed that your data is truncated on the library view and the field is published as Single Line of Text.

This is a known issue for Microsoft and looks like it is not yet fixed or won't be fixed. There is no solution to this, however, there are two workarounds which I can think of -
Option 1) 
Create a Multi line Textbox and if not required, uncheck the richtext options and publish the form.
Option 2) 
a) Publish the form library and if it is single line of text then create a Multi line text field on the form library.
b) Select Allow unlimited length while creating the column.
c) Go to the form publishing wizard, and on the field promotion, Select the field which you promoted, hit modify, and then map it with your new multiline field create on your library.
d) Now all your data is mapped to this new field, so you won't loose any record.
Cheers :) !