This guide takes you through step by step instructions to create a Leave Approval Workflow. This tutorial uses the form you created in the Getting Started with Forms tutorial.
...
Creating the Leave Approval Workflow
- Logon to your tenant as the designer user i.e.designer@mycompany. Replace mycompany with the name of your tenant.
On the My Project homepage, click the project name My Company HR that you created in the Getting Started with Forms tutorial. You can also select Open from theAction Menu.
- You will see the Forms and Workflows homepage.
- Click theAdd icon and select Create a New Workflow.
Name the workflow Leave Approval Workflow and give it a meaningful description. Click NEXT.
Tip You will be able to search your forms/workflows by Name and Description, so use keywords that will help you find it later.
- Now the Workflow Design Wizard will guide you through creating and assigning steps.
Rename Step 1 "Employee" and change the Step Type to Use Existing Form: Leave Approval. This will use your existing Leave Approval form to start the workflow.
Tip If you completed the Getting Started with Forms exercise, you should have a Leave Approval Form listed. If not, you can select Create New Form instead.
- Click Add and rename Step 2 "Manager". Leave the default Step Type of Approval Step. Change Assignment Type to "To a User". You can select any user in your tenant.
- Click Add and rename Step 3 "HR". Leave the default Step Type of Approval Step. Change Assignment Type to "To Role(s)" and select HR.
- Click FINISH. Here is what your workflow should look like:
Make Changes to the Leave Approval Form
You can edit a form in the Workflow designer as well as the Forms designer.
Warning |
---|
Be aware that changes made to a form in the Workflow Designer are not reflected in the original form in the Forms designer. If you want your changes reflected in both designers, make the changes in the original form in the Forms Designer, then replace the updated form in your workflow in the Workflow Designer. |
Let's add a rule to prefill the user name, id, email address and manager's name on each step of our workflow. Follow these steps:
- Click the Rules icon in the Guided Workflow Designer header. Notice that several rules are already in the list - the rule you created earlier "Sick Certification", as well as several rules the Workflow Design Wizard created to show/hide our approval sections. We'll add one more.
Click Add.
Give your rule a Name and Description. Click Run Builder.
- Add your condition and actions. For this rule, you don't need Else Actions. Your rule finished rule should look like this.
Expand title Click here for step-by-step instructions. Name the rule
No Format Populate the Employee Name, Email, and Manager Id when the Employee step loads
- Click the Run Builder button then click Add Condition. This is the Condition wizard
- Select the current step from the first dropdown.
- Select is from the second dropdown
- Select Employee from the third dropdown.
- Click Next
- This is the Action wizard where you set up actions that will happen if the condition is true
- Select FirstName from the first dropdown.
- Select to from the second dropdown
- Begin typing userFirstName in the third field then select the userFirstName function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up theFirstName field to be populated with the Employee Name using the built-in userFullName function.
- Click the Add Action button.
- Select LastName from the first dropdown.
- Select to from the second dropdown
- Begin typing userLastName in the third field then select the userLastName function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up the LastName field to be populated with the employee's user id using the built-in userLastName function.
- Click the Add Action button.
- Select Email from the first dropdown.
- Select to from the second dropdown
- Begin typing userEmail in the third field then select the userEmail function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up the Email field to be populated with the employee's email address using the built-in userEmail function.
- Click the Add Action button.
- Select ManagerId from the first dropdown.
- Select to from the second dropdown
- Begin typing userManagerID in the third field then select the userManagerID function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up the ManagerId field to be populated with the user id of the employee's manager using the built-in userManagerID function.
- Click Finish
- Click anywhere in the General Settings section of the Properties Navigator or click the Edit Workflow Properties icon in the toolbar to launch the Workflow Properties wizard. Check the Save PDF checkbox on the Settings tab so that a pdf image of the workflow is saved in the submission repository. Click Submit to save.
- Click on the Employee step. Click the Edit icon. This launches the Leave Approval Form in the form designer so you can edit it.
- Change the label of the First Name control to Employee Name. Change the Name of the First Name control to EmployeeName (no space).
- Change the label of the Last Name field to Employee Id.
- Change the Name of the Last name field to EmployeeId.
- Make sure that the Name field of each control is properly set. This is a critical step to ensure that business rules work. The controls are named as shown in the table below. Make sure that the Control Name field is exactly as shown below including case-sensitivity.
Uncheck the Enabled checkbox for each control. The control values will be automatically filled in by a business rule.
Click the save and exit icon to save the form.
- Click the save and exit icon to save the workflow.
Control Label | Control Name | Description |
---|---|---|
Employee Name | EmployeeName | the current user's full name |
Employee Id | EmployeeId | the login id of the current user |
Manager Id | ManagerId | the login id of the current user's manager |
Employee Email | the current user's email address |
Setup the steps in your workflow
- Edit the Leave Approval Workflow.
- Click on the Employee step. Click the Edit Step Properties icon. Click on the General Settings tab. Change the text of the Continue Button label by typing it in the Continue Label field. Ex: Send to Manager.
- Click on the Assignment tab. Assign the Employee role to this step by selecting it from the Assign to Role dropdown. Click Submit.
- Click on the Manager step. Click the Edit Step Properties icon. Click on the General Settings tab. Change the Continue Label to Send to HR. Manager Jerry will click on this button to send the workflow to the HR department.
Click on the Assignment tab. Type a left curly brace followed by Man in the Assign to User field. When you see {ManagerID} in the dropdown, click to select it. {ManagerID} is an example of a template. At runtime, will evaluate the user id in this field and sent the task to the Employee's manager. The ManagerID field will be populated by a business rule explained below when the workflow step loads.
- Click on the Messages tab.
- Add a customized message in the Pending Message field. Tom will see this message when he clicks the Send to Manager button. Ex: Your request has been forwarded to your manager for approval.
Add some text in the Task Information field so manager Jerry can identify the task when he sees it on the Task List. You can use a template in the message. A template is a control in your form encased in curly brackets. will resolve the template at runtime and replace the field in the Task Info with the data that is entered into it. If you want to show the Employee Name in the Task Information, enter Leave Approval for {EmployeeName} in the Task Information field so the approving manager will know who the request is for when it appears on their task list. .
- Click Submit.
- Click on the HR step. Click the Edit Step Properties icon. Click on the Assignment tab. Assign the HR role to this step by selecting it from the Assign to Role dropdown
- Click on the Messages tab.
- Enter "Leave Approval for {EmployeeName}" in the Task Information field.
- Enter a Pending Message that Jerry will see when he clicks the Send to HR button. Ex: The Leave Approval for {EmployeeName} has been forwarded to HR.
- Click Submit.
- Customize the message the HR user will see when the workflow is completed.
- Click on the Edit Workflow Settings icon in the toolbar.
- Click on the Workflow Actions tab. Select the Display Message when user submits workflow wizard.
- Enter your customized message
- Click Finish.
- Click the save and exit icon to save the work your have done so far.
...
A great way to test your workflow is to use a space. A space is a frevvo website that is very easy to create. Your deployed forms/workflows are automatically added. Follow these steps to create the space:
- Ensure the visibility of your Expense Report workflow is set to public in tenant and that it is deployed to production:
- In Workflow Properties, select the Access Control Tab. Set "Who can start the workflow" to "Anyone (login not required.)
- On the Forms & Workflows Homepage, click the Action menu for the Leave Approval Workflow. Select Deploy.
- In Workflow Properties, select the Access Control Tab. Set "Who can start the workflow" to "Anyone (login not required.)
- Click on the Spaces Tab. Click the Add icon. Enter an id and name for your space. Click Create. You will taken to the Space designer. Simply click the Save & Exit icon to return to your Space list.
- Click the Action Menu and select Share.
- Copy the share url for your space then logoff .
- Paste the space url into another browser or a new tab of the browser you are using. Login as tom@<your tenant name>. automatically makes your project a tab on the space menu and your Leave Approval Workflow an option on the menu under the tab. Your space should look something like this:
Click on the tab for your project and then click on the Leave Approval workflow. This brings you to the first step in your workflow. The workflow automatically has a navigation bar to indicate which step you are currently in as well as the next steps that are coming.
Fill in the fields in the 1st step, remember to sign and click the Send to Manager button to route the workflow to the Manager for approval.
Tom should see the customized pending message that you set up on the manager activity in the workflow.
- Logout of your space then login to the space as the manager jerry - jerry@<your tenant>.
- Click on the Important Items tab, then click the Task List. Jerry will see the pending Leave Approval request from Tom. Note the Task information that we set up on step 2 of the workflow using the template - Leave Approval for {EmployeeName}
- Click the Perform icon to display the task. Notice Manager Jerry sees the Employee Information section filled in by Tom and the Manager Approval section so he can approve or reject the request.
- The manager name and email fields are populated by our business rule.
- Add a comment and sign the section.
- Click the customized Send to HR button. The pending message that you set up on the HR step of the workflow displays.
- Logout of your space and login as sue@<your tenant>.
- Click on the Important Items tab and then on the Task List. The pending task for the HR department displays. Note Sue, the HR employee, sees the Employee Information section, the Manager Approval section and the HR section.
- Click the Finish button to complete the workflow. The workflow's configured form action message displays.
Logout of your space.
...