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. |
Add a Rule to Prefill Employee Information
Let's add a rule to prefill the user name, email address and manager's id on our workflow. Follow these steps:
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 | ||
---|---|---|
| ||
|
Save a PDF Snapshot
Next we'll make sure to save a PDF snapshot of this form that can be emailed for confirmation or added to the employee's file.
- Click the Settings icon in the Guided Workflow Designer header.
Check the Save PDF checkbox on the Settings tab so that a PDF image of the workflow is saved in the submission repository. Notice that a PDF Name area appears. Enter
Code Block Leave Approval for {LastName}.{FirstName}.{StartDate}
Tip Entering a control name inside curly brackets will replace that text with the run-time form/workflow data, providing you with a dynamic experience. Many place have a dropdown to help you select the correct control name, as this is case-sensitive.
- Click Save.
Add a Thank You Message
Add a message that the HR user will see when they complete the workflow.
- Select the Workflow Actions tab. Select the Display Message when user submits workflow wizard.
Enter you custom message
No Format Leave Approval successfully processed for {EmployeeName}.
Dynamically Assign the Manager Step
Dynamically assign this step to the right manager based on which employee starts the workflow.
- Click on the Assignment tab. In the Assign to User field, delete the user you originally assigned.
Type a left curly brace followed by Man. When you see {ManagerID} in the dropdown, click to select it.
Tip {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.
Customize the User's Experience
Next we'll customize the buttons and messages the users will see as they interact with the workflow.
Tip |
---|
You can navigate Workflow Step Properties two ways:
This example suggests the 2nd approach, but choose what works for you! |
- Click the Employee Step. The Workflow Step Properties will appear on the right.
- Change the text of the Continue Label field to "Send to Manager." This is what the user will see on the Continue Button, and provides more context about what the workflow will do.
- Click on the Manager step.
- Change the Continue Label to Send to HR.
- Click on the Messages tab.
- 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.
Add Task Information so manager Jerry can identify the task when he sees it on the Task List, such as "Leave Approval for {EmployeeName}"
- Click the Employee Step.
- Enter a Pending Message that Tom (employee) will see when he clicks the Send to Manager button. Ex: Your request has been forwarded to your manager for approval.
- Click on the HR Step
- Enter "Leave Approval for {EmployeeName}" in the Task Information field.
Add the Manager Approval Section
- Edit the Leave Approval Workflow. Click on the Employee step. Click the pencil icon to open the Employee step in the Forms Designer inside the Workflow Designer.
- Drag and drop a Section control below the Leave Approval Request section. Name the section Manager Approval.
- Drag a text field from the palette and drop it in the section. Type Manager Id as the label and ManagerId2 as the control name. Uncheck the Visible property.
- Click on the Style tab and change the width to 6 columns on the grid.
- Drop an Email control the the right of the Manager Name control. Type Manager Email as the label and ManagerEmail as the control name.
- Add a text area control with 3 lines and name the control Manager Comments.
- Select the section by clicking on its header.
- In the properties panel, select the Security Tab.
- Select Wet signature from the signature dropdown. Check the Must Sign checkbox to require a signature and verify that the Lock checkbox is checked to prevent tampering with the signed data .
Add the HR Section
- Drag and drop a Section control below the Manager Approval section. Name the section HR Approval .
- Drag and drop a text control into the HR section. Type HR Id for the label and HRId as the control name.
- Click on the Style tab and change the width to 6 columns on the grid.
- Drag and drop another text control to the right of the HR Name field in the HR section. Type HR Email for the label and HREmail as the control name.
- Add a text area control with 3 lines and name the control HR Comments
As before, in the Security Tab, select Text/Signature Image from the Signature dropdown and check the Must Sign checkbox to make the signature required.
Add Business Rules
The business rule to display the Certification control if the user checks the sick option in the Type of Leave field should show int the Rules list. We will use the Visual Rule Builder to add five additional rules to Step 1 of the workflow. We will need rules to:
- Show/Hide the Manager Approval section on the Manager and HR steps
- Show/Hide the HR Approval section on the HR step
- Populate the Employee Name, user id, email and manager when the Employee step loads.
- Populate the manager name and email if the workflow is on the Manager Approval step.
- Populate the HR employee's name and email when the workflow is on the HR step.
Info |
---|
The control names in the form must match the names used in the rules below. Control names used in a rule should be unique across the form. |
Show the Manager Approval Section on the Manager and HR Steps
- Click the rules icon in the Workflow Designer toolbar.
- Click theplus icon to add a rule.
- Show the Manager Approval section on the Manager and HR step
- Click the Run Builder button then click Add Condition - this is the Condition wizard
- Select the current step from the first dropdown.
- Select is on or after from the second dropdown.
- Select Manager 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 the Manager Approval section from the first dropdown
- Set the property to as visible by selecting it from the second dropdown.
- Click Next then click Add Action - this is the else action wizard where you set up actions that will happen if the condition is false
- Select the Manager Approval section from the first dropdown
- Set the property to as hidden by selecting it from the second dropdown.
- Click Finish.
The rule should look like this:
Show/Hide the HR Approval Section on the HR Step
- Click the plus icon to add a rule.
- Name the rule Show the HR Approval section on the HR step.
- 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 HR 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 the HR Approval section from the first dropdown
- Set the property to as visible by selecting it from the second dropdown.
- Click Next then click Add Action - this is the else action wizard where you set up actions that will happen if the condition is false
- Select the HR Approval section from the first dropdown
- Set the property to as hidden by selecting it from the second dropdown.
- Click Finish.
The rule should look like this:
Populate Employee Info When Form Loads
- Click theplus icon to add a rule.
Name the rule Populate the Employee Name, Email, Employee Id 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 EmployeeName from the first dropdown.
- Select to from the second dropdown
- Begin typing userFullName in the third field then select the userFullName function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up the EmployeeName field to be populated with the Employee Name using the built-in userFullName function.
- Click the Add Action button.
- Select EmployeeId from the first dropdown.
- Select to from the second dropdown
- Begin typing userID in the third field then select the userID function when it displays in the dropdown. Type in the closing parenthesis. Tab out of the field. This sets up the EmployeeId field to be populated with the employee's user id using the built-in userID 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 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 Finish
The rule should look like this:
Populate Manager Info on Manager Step
- Click the plus icon to add a rule.
Name the rule Populate the Manager Id and Email on the Manager step
- 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 Manager 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 ManagerID2 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 ManagerId2 field to be populated with the user id of the employee's manager using the built-in userManagerID function.
- Click the Add Action button.
- Select ManagerEmail 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 ManagerId after the opening parenthesis then add the closing parenthesis. Tab out of the field. This sets up the Email field to be populated with the email address of the employee's manager using the built-in userEmail function.
- Click Finish
The rule should look like this:
Populate HR Info on HR Step
...
Name the rule Populate the HR Employee Name and Email on the HR step
...
Click the save and exit icon to save the rules.
...
Workflow
Customize the User's Experience
Next we'll customize the buttons and messages the users will see as they interact with the workflow. First, click Workflow in the Guided Designer header to return to the Workflow Outline.
Tip |
---|
You can navigate Workflow Step Properties two ways:
This example suggests the 2nd approach, but choose what works for you! |
- Click the Employee Step. The Workflow Step Properties will appear on the right.
- Change the text of the Continue Label field to "Send to Manager." This is what the user will see on the Continue Button, and provides more context about what the workflow will do.
- Click on the Manager step.
- Change the Continue Label to Send to HR.
- Click on the Messages tab.
- 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.
Add Task Information so manager Jerry can identify the task when he sees it on the Task List, such as "Leave Approval for {EmployeeName}"
- Click the Employee Step.
- Enter a Pending Message that Tom (employee) will see when he clicks the Send to Manager button. Ex: Your request has been forwarded to your manager for approval.
- Click on the HR Step
- Enter "Leave Approval for {EmployeeName}" in the Task Information field.
Dynamically Assign the Manager Step
Dynamically assign this step to the right manager based on which employee starts the workflow.
- Click on the Manager Step
- Select the Assignment tab. In the Assign to User field, delete the user you originally assigned.
- Type a left curly brace followed by Man. When you see {ManagerID} in the dropdown, click to select it.
Tip |
---|
{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. |
Forms
Click on Forms in the Guided Designer header. Notice that in addition to the Employee Information and Leave Request sections that you added, there are now also sections labelled Manager Approval and HR Approval. These were added by the Workflow Design Wizard, along with rules that show/hide them on the correct step.
You can edit the form in the Workflow designer Forms view.
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. |
Rules
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.
Add a Rule to Prefill Employee Information
Let's add a rule to prefill the user name, email address and manager's id on our workflow. Follow these steps:
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
PDF Mapping
We'll skip this for now, because this workflow will produce a built-in PDF snapshot. Visit Generate Pixel Perfect PDFs for more details about you could map form data to an existing PDF.
Settings
Save a PDF Snapshot
Next we'll make sure to save a PDF snapshot of this form that can be emailed for confirmation or added to the employee's file.
- Click the Settings icon in the Guided Workflow Designer header.
Check the Save PDF checkbox on the Settings tab so that a PDF image of the workflow is saved in the submission repository. Notice that a PDF Name area appears. Enter
Code Block Leave Approval for {LastName}.{FirstName}.{StartDate}
Tip Entering a control name inside curly brackets will replace that text with the run-time form/workflow data, providing you with a dynamic experience. Many place have a dropdown to help you select the correct control name, as this is case-sensitive.
- Click Save.
Add a Submit Message
Add a message that the HR user will see when they complete the workflow.
- Select the Workflow Actions tab. Select the Display Message when user submits workflow wizard.
Enter you custom message
No Format Leave Approval successfully processed for {EmployeeName}.
Testing the Leave Approval Workflow
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.
...