Calculating day of the week in InfoPath without code

http://www.bizsupportonline.net/infopath2007/create-week-day-infopath-form-rules-formula.htm

http://sharepointissues.blogspot.sg/2012/09/calculating-day-of-week-in-infopath.html

 

(number(substring(Date, 9, 2)) + number(number(substring(Date, 1, 4)) – (floor((14 – number(substring(Date, 6, 2))) / 12))) + floor(number(number(substring(Date, 1, 4)) – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 4) – floor(number(number(substring(Date, 1, 4)) – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 100) + floor(number(number(substring(Date, 1, 4)) – (floor((14 – number(substring(Date, 6, 2))) / 12))) / 400) + floor((31 * number(number(substring(Date, 6, 2)) + 12 * (floor((14 – number(substring(Date, 6, 2))) / 12)) – 2)) / 12)) mod 7

It will return the following:
1) If the value returned in “Day of the Week” field is 0 then it is Sunday
2) If the value returned in “Day of the Week” field  is 1 then it is Monday
3) If the value returned in “Day of the Week” field is 2 then it is Tuesday
4) If the value returned in “Day of the Week” field is 3 then it is Wednesday
5) If the value returned in “Day of the Week” field is 4 then it is Thursday
6) If the value returned in “Day of the Week” field is 5 then it is Friday
7) If the value returned in “Day of the Week” field is 6 then it is Saturday

Advertisements

InfoPath: Hide command text for conditionally inserting row in repeating table

Solution:

  1. Select the repeating table, right click on it to open up context menu.
  2. Click on “Repeating Table Properties…” > “Display Tab” > “Conditional Formatting…” button. It will open up “Conditional Formatting” dialog.
  3. Click on “Add…” to open up “Conditional Format” dialog.
  4. Select the condition and check “Don’t allow user to insert or delete this control” as shown in the image below.
  5. Click OK button on every open dialog.
  6. Now preview the form. Based on evaluated condition, clicking on “Add Employee” will either allow or don’t allow you to insert a new row.

.

Get InfoPath to display lookup column value, not ID

If you have ever used a SharePoint list containing lookup columns as a data source in your InfoPath forms, you may have been disappointed to see the value of the lookup is not displayed. Instead of the value, the list ID of the item containing the value is displayed.

Below link has the detailed post.

http://sharepointsolutions.com/sharepoint-help/blog/2011/11/get-infopath-to-display-lookup-column-value-not-id/

 

Autonumber repeating table rows in InfoPath 2010

Thanks to S.Y.M. Wong-A-Ton (www.bizsupportonline.net)

You can in InfoPath autonumber repeating table rows as follows:

  1. In InfoPath Designer 2010, create a new Blank Form template.
  2. On the Home tab under the Controls  group, click Repeating Table and add a repeating table with 3 columns to the form template.
  3. Right-click the first field (field1) in the repeating table and choose Change Control and then Calculated Value from the context menu that appears.
  4. With the first field (field1) still selected, click the Properties tab or double-click field1 to bring forward the Properties tab.
  5. On the Properties tab under the Properties group, click Default Value.
  6. On the Field or Group Properties dialog box on the Data tab under the Default Value section, click the formula button behind the Value text box.
  7. On the Insert Formula dialog box, select the Edit XPath (advanced) check box.
  8. On the Insert Formula dialog box, type the follow formula into the Formula text box:count(../preceding-sibling::*) + 1
  9. On the Insert Formula dialog box, click Verify Formula to ensure that the formula does not contain any errors. Click OK to close the message box that says whether the formula contains or does not contain errors. Correct any errors if necessary.
  10. On the Insert Formula dialog box, click OK.
  11. On the Field or Group Properties dialog box, ensure that the Refresh value when formula is recalculated check box is selected, and then click OK.
  12. Save the InfoPath form template and publish it for example to a SharePoint form library.