You are here: Getting Started > Tutorials > Tutorial 3: Building advanced forms and workflows > T3-7. Add functions and form logic

Tutorial 3–Step 7: Add functions for form logic

In this exercise you will insert 2 functions into the form:

  • The first function (Concat) combines information from 2 different fields into a single string
  • The second function adds the current date to the form.
  1. Open the Time Off Request Solution created in Tutorial 1.
  2. On the Designer toolbar, click the Launch InfoPath button.

  3. Make sure you are in the Originator View.
  4. In the Last Name row, right-click in a blank space, and then click Insert Row Below.

  5. In the left hand side of the table, enter the text Full Name, and then insert a new text box on the right side.

  6. Rename the text box to FullName.
  7. Right-click the FullName Text box, and then select Text Box Properties.
  8. Click the function button (), and then select Insert Function.

    Select the Concat function, and then click OK.

  9. Double-click the 'Double-click to insert fields' link to insert the fields FirstName and LastName.
  10. Delete the third and last 'Double click to insert field' link.

  11. Click Verify Formula, and then click OK if successful.

    If you received an error, check your spacing and character placement.

  12. Right-click the Date of Request field, and then select Date Picker Properties.
  13. Click the function button (), and then click Insert Function.
  14. In the Categories menu, select Date.
  15. From the Function menu, click Today, and then click OK and Save your form.

  16. Preview your form and check to see that the fields Full Name and Date of Request are working properly.
  17. You will need to fill out the fields First Name and Last Name for the Full Name field to work.