3.1 Create the Workflow
- From the App Home tab, in the "Logic and automation" section, click Add.
From the Add Automation Screen, we are provided with a variety of process automation templates we can use to speed creation of common activities.
- Click "Flow".
- Click Build from scratch to create a new workflow.
A Flow is a sequence of actions to automate processes on the Now Platform.
Logic and automation use computers to manage repeatable processes instead of using people. Logic and automation can reduce human error and speed up processes. App Engine Studio allows creators to add process flows to their applications.
Create the flow with the following information:
Field Value Name Main Description Manage the Telework flow of work. Click on the
button.
- Click the Edit this flow button to begin the configuration process.
- You may see a tour popup. Let's skip the tour for now, by clicking the Skip tour button.
The first thing we'll do is set up our trigger to define when this flow will run.
Click on Add a trigger in the upper left of the flow designer screen.
Flow designer provides different options for triggering a workflow. You can kick off a flow based on a record being created or updated, , run on a scheduled basis, or based on a unique application component like an SLA task being triggered or an inbound email being received by the instance. For our use case we are going to:
- Select Created from the Record section.
- Select the Telework Case table.
- Click to close the trigger.
noteThere might be circumstances under which we need to have a particular flow to execute. In this case we can use the "Add filters" option to define conditions that must be met for this flow to execute. This helps making flow easier to maintain and reuse. For example, we could use a flow specific to new request, one for renewal or request.
- Now we'll add the actions to execute when this flow fires.
- Click Add an Action, Flow logic, or Subflow.
- Choose Action.
- The first step in the process we want to automate is managing the approvals across departments.
- In the search field, type "approval".
- Select Ask for Approval.
- The first thing we need to configure is the record we'll be working with for this action.
- Click on the data picker.
- Select Trigger – Record Created.
- Select Telework Case Record.
- In the Rules section, let's configure the approval rule.
- Choose Anyone approves for the Approval rule.
- Click on the Data Pill Picker button (the magic wand button).
- Click Trigger - Record created.
- Click on the chevron to access the list of fields.
- Locate the Opened by field and click on the chevron next to it.
- Select Manager.
We just configured an approval request to the manager of the person who submitted the form.
- Click .
- Now let's configure what happens when the manager approves:
- Under the Ask for Approval, click on the "Add an Action. Flow logic or Sub flow.
- Select Flow Logic.
- Select If.
- Let's define the condition:
- In the Condition Label field type "Manager approves".
- Click on the Data Pill Picker (magic wand button).
- Click 1 – Ask for Approval.
- Click Approval State.
- Set drop-down to Approved.
- Click .
We now have a branch where we can add actions or flow logic if the manager approves.
Let's save the team from sending tasks via emails or other systems.
Next, we will configure the Flow to automatically request I.T. to assign a Remote Access Token to the employee.
Under If Manager approves click the small + to add a step.
Select Action > ServiceNow Core > Create Task.
For Table, select "Ticket".
Click Add field value.
Search and select Parent.
Click on the Data Pill Picker (magic wand button).
Select Trigger - Record created > Telework Case Record.
Click + Add field value and add two other fields:
Field Name Field Value Short description Remote Access Token Assigned to for testing assign it to yourself (System administrator)
This is how the Field Values should look: 9. Let's add an annotation and set it to "Request Remote Access Token". 10. Click
.
First, let's take care of automating the notifications that take too much time right now.
We'll send an email to the applicant's and let them know their application has been approved.- Under 3 - Create Task click the small + to add a step.
- Select Action > ServiceNow Core > Send Email.
- Let's add an annotation and set it to "Notify Requester".
- For the Target record, use the Data Pill Picker to select Trigger - Record created > Telework Case Record.
- For the To field,
- Click on the record picker.
- Select Trigger - Record created.
- Click on the chevron to access the list of fields.
- Locate the Opened by field and click on the chevron next to it.
- Select Email.
- For the Subject, enter:
Your Telework application is approved.
- For the Body:
- Start by entering: "Dear " (followed by a whitespace).
- Use the record picker to select the Opened by > Name field.
- Hit Enter to move to the next line.
- Type "Your application for ".
- Use the Data Pill Picker to select the Arrangement > Code field.
- Type " is approved" after the data pill (preceeded by a whitespace).
- The Body should look like this:
- Click .
- Your flow should look like this:
- Click on the Toggle view to visualize the flow as a Diagram.
- In the top right corner of the screen, Click .
Although the Flow is saved, it won't run until we activate it.
- Click on the left of the Save button.
- In the Confirmation box click the button.
Congratulations! 🎉
You've built a flow that takes care of managing tasks and communications across multiple departments.
Note that by default Personal Developer Instances have "sending email" turned off by default. If you want to receive the email, make sure that the user submitting the application has a valid email address on their user record.
Next, let's test our work and see it in action.