Posts

Showing posts with the label InfoPath forms

How to access repeating table/section fields in Info Path Web Browser Forms

Accessing or validating fields within a repeating table/section using web  browser forms might be a little bit tricky, as web browser forms will not allow you to reference specific rows by index, use Last() or Position() functions... There are some XPath formulas that you can use to access or validate fields within a repeating section with out having to use any extra code in your form. These are some examples: Check if a repeating section/table has duplicate rows: count( XpathToRepeatingGroup [following-sibling::*/ FieldToBevalidated = FieldToBeValidated ]) > 0 If value returned by the XPath expression is greater than 0 then the repeating table contains duplicate rows. The number returned by the XPath expression will be the number of duplicate rows that your repeating section contains. Do not forget to include in the condition when field is not blank, as blank values count as duplicates. Get the previous row value: ../ preceding-sibling:: my:RepeatingGroup [count(prec...

How to convert fields in lower case/upper case within Info path forms

Info path forms does not have any function to convert fields to lowercase or uppercase but there is an easy way to do it by using the translate function. Basically, the  translate  function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding in the third argument. Using the translate function we can convert fields  from upper case to lower case, first word in upper case... or even use it to remove all the dashes and colons. The Translate function is better than the Replace function as can change several words at the same time. If we want every single character to get converted, we will have to specify every letter in the alphabet in upper case and then lower case to make sure every character will get converted. These are some examples: Converting from UPPER case to Lower case: translate( FieldToConvert , "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz") C...

Auto-populate the person/Group picker from the current user on InfoPath 2007/2010/2013

Image
If you need to fill the default value of the person/group picker with the current logged user when the form is loading, there is an easy way to do it. The following steps will show you how to do it: Create a web service connection to get the user profile information from the current user: Manage Data Connections -> Add -> Receive Data -> SOAP Web Service: Include the location of the SOAP Web service definition: http:// YourServer /_vti_bin/UserProfileService.asmx?WSDL Select GetUserProfileByName Make sure the "Automatically retrieve data when form is opened" option is ticked.   2. Add a Person/Group picker field to your info path form  3. Create a new action rule in the "Form Load" to run under a condition, if needed, i.e: Add the current user into the Person/Group picker field when the Person/Group picker field is blank:  DisplayName is blank 4. Set the Person/group picker DisplayName to Pref...