Chapter 14

Creating Workflows with Microsoft Flow

IN THIS CHAPTER

Bullet Understanding workflow for SharePoint

Bullet Figuring out how Microsoft Flow works with SharePoint

Bullet Using SharePoint Designer to build workflows

Bullet Connecting SharePoint with other products using workflow connectors

Any organization is made up of processes. Some processes might be very simple, such as checking an email, responding, and then filing it in a folder. Other processes are more complex and might involve multiple people and computer systems. In any case, processes — and workflows — are at the core of an organization.

In this chapter, you explore the workflow options available for SharePoint. You discover how Microsoft Flow has changed the game for workflow and expanded it beyond SharePoint, beyond Office 365, and beyond Microsoft. You also find out how to build a workflow using Microsoft Flow and connect that workflow to other services.

Finally, you explore the traditional SharePoint workflow capabilities that continue to provide you options within the confines of your SharePoint environment.

Understanding Workflow

A workflow can be used to manage a human-centric process or a computer-centric process. For example, you might have a process that involves five people working partly in parallel and partly in sequence. If these five people are all in the same room and accomplish the process in one sitting, then using a workflow to coordinate their activities wouldn’t make much sense. If the people are dispersed in different offices or cubicles, or the process takes place over a period of time, then a workflow can be used to coordinate and keep the process on track.

In addition, a process might interact with other computer systems. For example, you might have a process that needs to pull customer data from a Customer Relationship Management (CRM) system. Or you might want to pull data into SharePoint from Twitter and the CRM so that a workflow is triggered whenever someone complains publicly on Twitter. Just about anything you can dream up can be built into a workflow.

Introducing Microsoft Flow

Microsoft Flow is the next generation of workflow. It was born in the cloud and designed from the ground up to interact with Office 365 products as well as third-party products (external to Microsoft) such as Dropbox, Amazon, Twitter, Facebook, and nearly any other online service in the world. It enables employees to create and automate workflows across multiple applications. When you think of Microsoft Flow, think of an online workflow engine that is available to the Internet — not just to Microsoft products.

Signing into Microsoft Flow

Microsoft Flow is accessed in one of two ways:

  • Select the Flow icon in the Apps menu from within any Office 365 service (such as SharePoint), as shown in Figure 14-1.
  • Go to the Microsoft Flow web page at https://flow.microsoft.com.
Screenshot for opening Flow from the Office 365 apps menu in the SharePoint site.

FIGURE 14-1: Opening Flow from the Office 365 apps menu in SharePoint.

Getting familiar with Flow

The Microsoft Flow service uses your web browser as a design tool for building out automated workflows called flows. The design environment is shown in Figure 14-2. Notice the navigation options that appear along the left side of the page: Home, Approvals, My Flows, Templates, Connectors, Data, and Learn.

Screenshot of the main Microsoft Flow page for creating automated workflows using the web browser as a design tool.

FIGURE 14-2: The main Microsoft Flow page.

The Home navigational link always takes you back to your start page if you ever get lost. The start page includes overview information and is always a good place to return when working with Flow.

The Approvals link takes you to the approvals page, as shown in Figure 14-3, where you can build a new approval workflow or interact with approvals that you have sent or received. You can even see the history of the approvals on this page.

Screenshot of the Approvals page for Microsoft Flow to create a new approval workflow or interact with approvals that have been sent or received.

FIGURE 14-3: The Approvals page for Microsoft Flow.

The heart of the Flow interface is the My Flows page. When you click this navigational link, you see all your Flows and the Flows for your team.

The Templates link takes you to the Templates library. Templates are prepackaged flows that you can use and customize for specific scenarios. For example, there is a flow to send yourself a reminder in 10 minutes or start an approval when a new item is added to SharePoint or Outlook. There are an incredible number of templates available, and new ones are added all the time. Chances are, if you already have a workflow in mind, someone has created a template for it.

Next up on the navigational menu is Connectors. Connectors are where Flow gets its power. There are connectors that, well, connect Flow to all types of services and products. This is where you can build workflows that interact with popular sites and products. Remember when we mentioned Dropbox, Amazon, Twitter, and Facebook? This is where you find connectors for those products, as well as nearly any other online service or product in the world.

The Data navigational link expands to Entities, Connections, Custom Connections, and Gateways. This is where you can pull data into your flows so that it can be analyzed and decisions in the workflow process can be made. Once you get up to speed with Flow, you will spend a lot of time in this area.

Finally, the Learn navigational link is where you can find step-by-step learning guidance from Microsoft.

Building your first flow

A basic, but useful, workflow is to send a customized email when a new item is added to your SharePoint site. For example, imagine a ticketing app you have built using a SharePoint List (see Chapter 11 for more about creating List-based apps). Whenever someone adds a new item to the app, you want to fire off an email to a group of people so that they know a new ticket has been added. Let’s build this workflow using Flow.

To build a workflow to send a customized email when a new item is added to your SharePoint List app follow these steps:

  1. In SharePoint, click the Office 365 apps menu in the upper-left corner and select Flow.

    A new tab opens on your web browser and the Microsoft Flow page loads.

  2. Click the Templates navigational link on the left side of the page.
  3. Type sharepoint into the search box and press Enter to display the templates that relate to SharePoint, as shown in Figure 14-4.

    A template is already available to do exactly what we are trying to do.

  4. Click the “Send a customized email when a new SharePoint list item is added” template (shown as the first template in Figure 14-4).

    The page for this template appears and provides a visual for how the workflow flows. (Pun intended.) You can see in Figure 14-5 that the workflow originates in SharePoint and then moves to Office 365 and Outlook (email). The arrow pointing to the right indicates the direction the data is sent. Farther down the page are the permissions that are required for this email (see Figure 14-6).

    Tip Something we appreciate about Microsoft services is that authentication is handled for us automatically. If you look at the permissions required for this workflow (Figure 14-6), you will see it actually crosses services. Since our user is part of Office 365, we don’t need to set up any extra permissions. It “just works” with any services in our Office 365 subscription.

  5. Click Continue and then click the SharePoint Site Address drop-down menu and choose the SharePoint site where your List-based app resides.

    In our example we chose our For Dummies site.

  6. Click the SharePoint List Name drop-down menu and select the List-based app the workflow will use.

    In our example we chose For Dummies Support app, as shown in Figure 14-7.

    Tip It can take a little time for a SharePoint site or List-based app to appear in these drop-down menus. If you just created something and it is not showing up, go grab a coffee and check back later.

  7. Click Create Flow to create the workflow and attach it to your SharePoint List-based app.

    Now whenever a new item is added to the list, an email will be sent as a notification. You can customize the workflow with the destination email, email message, and timing by editing the Flow. You will find it on the My Flows page.

Screenshot displaying the Flow templates that relate to SharePoint, by clicking the Templates navigational link on the left side of the page.

FIGURE 14-4: The Flow templates that relate to SharePoint.

Screenshot displaying the data flow for a custom email when a new SharePoint list item is added, depicting how the workflow flows.

FIGURE 14-5: The data flow for a custom email workflow.

Screenshot of the Flow window displaying the SharePoint Site Address drop-down menu to choose the SharePoint site from the list-based apps.

FIGURE 14-6: The permissions for a custom email workflow.

Screenshot of the Flow page for selecting a SharePoint site and List app for a Flow-based workflow - the “For Dummies Support” app.

FIGURE 14-7: Selecting a SharePoint site and List app for a Flow-based workflow.

Tip Using Microsoft Flow, you can build workflows that integrate SharePoint with just about any other software you can imagine. Spend some time exploring the templates and when you are feeling comfortable, start customizing the templates to suit your own needs and then move into building your own custom Flows from scratch.

Using the Traditional SharePoint-Only Workflow

Microsoft Flow is the future of workflow because it flings open the doors of SharePoint and connects it to the rest of the world. Some organizations might still prefer to use the traditional SharePoint workflow that keeps all workflows within SharePoint itself. In this section, we explore the traditional SharePoint workflow system so you can decide if you want to stick with it or are ready to jump to the future of workflow with Flow.

The primary tool used to develop a SharePoint workflow is called SharePoint Designer. SharePoint Designer includes a no-code interface for developing workflows using components such as actions, tasks, steps, loops, and goto statements. When you need more advanced capabilities, you use a tool called Visual Studio to extend workflows beyond what SharePoint Designer can handle.

Tip SharePoint Designer is not being developed further. It is still available and supported because it is used to build workflows with the traditional SharePoint workflow capabilities. However, we don’t recommend investing too much time into SharePoint Designer, as Microsoft has clearly messaged that all of its investment areas are in Microsoft Flow for workflow purposes.

Remember To build a traditional SharePoint workflow, you still use SharePoint Designer.

Getting Up to Speed on SharePoint Designer

SharePoint Designer is a client application that you use to connect to your SharePoint site and build workflows (among other things). When you open a SharePoint site, you first open your web browser, and your web browser connects to the SharePoint site located on a server. SharePoint Designer works in the same manner. You download it, install it, and then open and connect it to a site.

You can download SharePoint Designer from the Microsoft Download Center located at www.microsoft.com/download. Make sure to search for SharePoint Designer and download the latest version (and any relevant updates).

Connecting to a SharePoint site

After you have SharePoint Designer installed on your computer, you’re ready to connect it to a SharePoint site. To connect SharePoint Designer to a SharePoint site, follow these steps:

  1. Open SharePoint Designer.

    The SharePoint Designer application opens on your computer.

  2. Click the Open Site button.

    The Open Site dialog box opens.

  3. Type the URL to your SharePoint site in the Site Name text box.

    Make sure to include http:// in the URL of the site. For example, http://intranet.portalintegrators.com/sites/site1 would be what you would type for a site called site1.

    The dialog box refreshes and shows you all the contents of the site. This includes any subsites. This is useful if you can't remember the subsite URL. You could type the parent site, such as http://intranet.portalintegrators.com, and then browse to the subsite named site1.

    Tip After you have connected to a site once, you see the Site URL as a button to automatically connect again below the Open Site button in SharePoint Designer. You don’t need to type the URL each time you want to connect.

  4. Click Open to open the site in SharePoint Designer.

    When you connect to a SharePoint site, you see the navigational components along the left side, as shown in Figure 14-8.

Screenshot displaying the navigational components of the SharePoint Designer on the left side of the page, to connect to a SharePoint site.

FIGURE 14-8: The navigational section of SharePoint Designer.

Creating a workflow

You can create three types of workflows in SharePoint:

  • A List workflow is attached to an app and works with only that app. For example, you might create a List workflow for a Documents app that is used for approval. Or you might create a List workflow for a Contacts app that emails you whenever a new contact is added.
  • A Reusable workflow is not associated with a single app but can be used by many apps.
  • A Site workflow is not associated with any app at all but is used by the website in general.

The most common scenario is using a List workflow for a particular app.

Remember An app can be based on a SharePoint list or library. When you create an app, you choose the template it should use. A List workflow is tied to a specific app that has already been created.

Tip The term List workflow might cause some confusion. SharePoint uses the term app instead of list. (This workflow type should really be called List-Based App workflow to come in line with SharePoint naming conventions.)

To create a List workflow for a Documents app, follow these steps:

  1. Click Workflows in the left navigation pane of SharePoint Designer.

    The current workflows in the site are displayed.

  2. In the New section of the Workflows tab, click the List Workflow drop-down menu and choose the app that you want to associate with the workflow.

    In this example, we build a workflow for the Documents app, so we select Documents from the drop-down menu.

  3. In the Name and Description text boxes, type the workflow name and description.
  4. Select SharePoint Workflow from the Platform Type drop-down menu.

    The workflow opens in SharePoint Designer.

At this point, you’re ready to add actions, conditions, steps, stages, and loops to your workflow. There are endless possibilities with workflow scenarios in SharePoint. Covering workflow development is beyond the scope of this book, but if you play around with the actions, you will start to get the hang of it quickly. In addition to building your own workflow from scratch, you can use the out-of-the-box workflows.

Most business processes can be achieved with the out-of-the-box actions, conditions, steps, stages, and loops. Custom actions can also be created by a programmer using Visual Studio.

Tip You can finding a detailed listing of the actions, conditions, steps, stages, loops, and other aspects of SharePoint workflow on MSDN at https://msdn.microsoft.com/en-us/library/office/jj164026.aspx.

Rediscovering the Out-of-the-Box Approval Workflow

If you’re familiar with the out-of-the-box workflows from past versions of SharePoint, you will be glad to know that they are still included in SharePoint. They are now included as a site collection feature that is deactivated by default. To turn them on, you need to activate the Workflows feature for your site collection, as shown in Figure 14-9.

Screenshot of the Office 365 window for activating the out-of-the-box approval workflows that have been listed out.

FIGURE 14-9: Activating the out-of-the-box approval workflows.

To find out more about activating features in SharePoint, see Chapter 17.

The out-of-the-box approval workflows use the legacy SharePoint workflow platform. They are turned off by default for performance reasons.

Tip Unless you have a great reason, like you are being told to use these workflows, we would recommend making the leap to Microsoft Flow. You saw earlier in the book how approvals can be setup with Flow and you get a lot more functionality.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset