Regex to validate email ids in InfoPath

Requirement – InfoPath form’s column should allow multiple valid email ids to be keyed in, separated by a comma.

InfoPath allows validation of an email id by default. It has a pattern to compare to. However, when the need arises to have multiple email ids inserted in a column, how to validate if all are valid email ids and are separated by a comma?

Solution – Write a validation rule for the column. The condition would be

Field: Email

Condition: does not match pattern

Custom pattern:  ([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\s*,\s*([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3}))*


Regex to validate title text in InfoPath

Requirement – InfoPath form title column should allow only alphabets and numbers to be keyed in, no special characters should be allowed.

Solution – Write a validation rule for the column. The condition would be

Field: Title

Condition: does not match pattern

Custom pattern:  -?[ a-zA-Z0-9]*[ a-zA-Z0-9]+



Repeating table’s column promotion/concatenation when data is from secondary source

When a repeating table has data from the Main data source, you can concatenate and promote the columns as I have already discussed in my previous blog here.

And I was with the mindset that it would work with secondary data source as well, but that was my misconception.

When a repeating table is bound using a secondary data source, then the formula to concatenate the columns of the table changes.

If we use the same old formula, the output won’t be as expected.

Continue reading

Extracting Info Path Attachment using Nintex

Of late I had been working with Info Path forms, always using the attachment control to upload files. However, anytime I had to see the attached file or use it to send in an email, I had to open my Info Path form. Obviously not a very great approach as my users didn’t wanted to do this all the times. 

This led me to do a bit of research and here I am able to extract the attachment using a Nintex workflow. Below is the simple sequence of steps to achieve the same. Continue reading

Redirection to a page on InfoPath form closure inside an InfoPath Form Web Part

Info Path Form Services is a wonderful component of Microsoft Office that allows the development of simple forms with moderate complexity. The service allows Info Path forms to be hosted in a SharePoint web site and served using a browser-based interface. With only rules and no code (most of the time) and a browser enabled form, the Info Path Form works for machines even though the Info Path client is not installed. In a nutshell, the Info Path form solves much of your problems without writing any code and even without the client – quite useful to me most of the times.

Problem Statement
However, every time I create a rule to close the Info Path form after submit or cancel event, I end up with a message “Form has been closed”. My users were definitely not happy with it. They wanted to be redirected to some page after they close the form, instead of seeing the above blank message and again going to the desired page through navigation. So I thought to find a permanent solution to this and put an end to this problem. Here goes my post explaining the same. Continue reading

How to set current user details in an Info Path form

userName() method of Info Path form returns the user id/ account id. To get other details such as display name, email id, manager, phone number, etc., we can use the web service “UserProfileService.asmx”

Lets say we want to get the display name, email and accound id for the currently logged in user.

Continue reading

Clubbing InfoPath Form & Nintex Approval Form

Whenever an Info Path form published to a form library has to undergo approval using Nintex, the default approval form will have options to approve/reject and provide the comments. However, not all details of the form can be seen on the same page (until it is a list item’s approval page). Only the fields promoted from the Info Path form to the library can be seen in the approval page. So here’s the reason why I’m posting this article. In my case, the customer came back to me saying why can’t they have a single form that displays the details of the library item i.e. the Info Path form along with an option to approve / reject at the bottom of the same form. So, a bit of research helped here and here’s the solution.

Continue reading