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
Tutorial 3: Building an advanced from and workflow
- Build a form in InfoPath
- Add and change swimlanes
- Create a starting workflow
- Publish the form
- Create an intermediate workflow
- Create Manager and HR form views
- Add functions for form logic
- Create an advanced workflow
- Create a SharePoint list and data connection
- Use transitions and promote fields
- Publish Transaction script as a Web service
- Add custom controls to InfoPath
- Configure custom controls in InfoPath
- Configure custom controls in InfoPath (advanced)
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.
- Open the Time Off Request Solution created in Tutorial 1.
- On the Designer toolbar, click the Launch InfoPath button.
- Make sure you are in the Originator View.
- In the Last Name row, right-click in a blank space, and then click Insert Row Below.
- In the left hand side of the table, enter the text Full Name, and then insert a new text box on the right side.
- Rename the text box to FullName.
- Right-click the FullName Text box, and then select Text Box Properties.
- Click the function button (), and then select Insert Function.
Select the Concat function, and then click OK.
- Double-click the 'Double-click to insert fields' link to insert the fields FirstName and LastName.
- Delete the third and last 'Double click to insert field' link.
- Click Verify Formula, and then click OK if successful.
If you received an error, check your spacing and character placement.
- Right-click the Date of Request field, and then select Date Picker Properties.
- Click the function button (), and then click Insert Function.
- In the Categories menu, select Date.
- From the Function menu, click Today, and then click OK and Save your form.
- Preview your form and check to see that the fields Full Name and Date of Request are working properly.
- You will need to fill out the fields First Name and Last Name for the Full Name field to work.