Category Archives: InfoPath

Infopath: Limit the number of words in single line text and/or multiple line of text fields

  1. Add a Validation rule.
  2. Under Condition choose The expression from the drop down.
  3. Paste in the following expression (replace 60 with the number of words you want to limit it to):

    string-length(.) – string-length(translate(., ” “,””)) > 60

 

Also posted in SharePoint | Tagged , , | Leave a comment

Infopath Extract Day, Month, or Year in InfoPath from a Date Picker field or Today

In InfoPath, under FieldsRight Click on the single line of text field and choose Field Properties.

Under the Default Value section click the “fx” button beside the blank field.

To extract the day number of a date, use
number(substring(field1, 9, 2))

To extract the month number of a date, use
number(substring(field1, 6, 2))

To extract the year number of a date, use
number(substring(field1, 1, 4))

where field1 represents a date picker control or the function of today() to pull any of those from today’s date.

Also posted in SharePoint | Tagged , , | Leave a comment

InfoPath: Make a field force the contents to be uppercase or lowercase.

Under Fields, Right Click on the field and choose Field Properties.

Under the Default Value section click the “fx” button beside the blank field.

To force the field to be upper case put in this formula:
translate(., “abcdefghijklmnopqrstuvwxyz”, “ABCDEFGHIJKLMNOPQRSTUVWXYZ”)

To force the field to be lower case put in this formula:
translate(., “ABCDEFGHIJKLMNOPQRSTUVWXYZ”, “abcdefghijklmnopqrstuvwxyz”)

Also posted in SharePoint | Tagged , , | Leave a comment

SharePoint/InfoPath: Get item Attachment URL for link

In InfoPath add a hyperlink (under the INSERT tab)

Under link to click Data Source.
Click the data source icon
 – Click Show advanced view at the bottom
   – Click the “+” next to dataFields
     – Click the “+” next to my:SharePointListItem_RW
       –  Click the “+” next to Attachments
         – Click on :attachmentURL
Click OK

Beside Display choose whatever text you would like it to display.

Click OK

Also posted in SharePoint | Tagged , , | 1 Comment