You are on page 1of 97

Getting started with Microsoft Flow

This free book is provided by courtesy of C# Corner and Mindcracker Network and
its authors. Feel free to share this book with your friends and co-workers. Please
do not reproduce, republish, edit or copy this book.

Vijai Anand
TABLE OF CONTENTS
1 Introduction to Microsoft Flow.............1

2 Prerequisites.3

3 Create a flow from the built-in templates4

3.1 Send a customized Email, when a new SharePoint list item is added..4

3.2 When an item in a SharePoint list is modified, send an Email.15

3.3 Save my Email attachments to a SharePoint document library.23

3.4 Send me an Email, when a new file is added in SharePoint online..30

3.5 Save tweets to a SharePoint list36

3.6 Save updates from Facebook to a SharePoint List40

3.7 Send SharePoint list items for an Email approval.44

4 Create a Flow from blank.53

4.1 Post to my Facebook timeline, when a new item is created in a SharePoint List..53

4.2 Post to Facebook or Twitter based on condition, when SharePoint list item is
created...........59

5 Manage Flows..68

5.1 My Flows Page..68

5.2 Turn on/off Flow..69

5.3 Edit/update Flow.70

5.4 Delete Flow.72

5.5 Flow History73

6 Manage Connections..74

6.1 My Connections Page..74

6.2 Create New Connection.75

6.3 Connect via on-premise data gateway77

6.4 Delete connection..80


7 Manage gateways....81

7.1 Install and Manage on-premise data gateway81

Reference: .93

Summary: ..93
About the Author

Vijai Anand has been working in IT industry for over 7 years. He holds a Bachelor's degree in Electronics and
Communication Engineering. He works as a Technology Specialist in Cognizant Technology Solutions, New
Jersey. Vijai has worked on Microsoft SharePoint 2016, Office 365, Microsoft SharePoint 2013,
Microsoft SharePoint 2010 and Microsoft Office SharePoint Server 2007.

Vijai is a frequent contributor to C# Corner ( www.c-sharpcorner.com). He has authored around 550 articles
and 570 blogs on www.c-sharpcorner.com for SharePoint 2016, Office 365, SharePoint 2013, SharePoint
2010, SharePoint Workspace, SharePoint Designer 2010, Powershell, C #, and Silverlight. He currently holds
Microsoft Most Valuable Professional for SharePoint Server.

He has authored the following eBooks:


Powershell Scripts: Basic Operations on SharePoint 2013 Online using CSOM, that was published on
C# CORNER.
SharePoint 2013 .Net Client Side Object Model Cookbook, that was published on C# CORNER.
Getting Started with Managed Metadata Service in SharePoint 2010, that was published on C#
CORNER.
Business Data Connectivity Services - Step by Step tutorial that was published on ITFUNDA.com

He has accomplished the following Microsoft Certifications:


Microsoft SharePoint 2013, Developing Microsoft SharePoint Server 2013 Core Solutions
Microsoft SharePoint 2010, Application Development
Microsoft SharePoint 2010, Designing and Developing Microsoft SharePoint 2010 Applications.
Microsoft Office SharePoint Server 2007, Application Development
Microsoft Office SharePoint Server 2007, Configuration

Vijai Anand
(C# Corner & Microsoft MVP)
1
1 Introduction to Microsoft Flow

Microsoft Flow is a preview product to help you set up an automated Workflow between your
favourite apps and Services to synchronize the files, get notifications, collects data and more.
Previously, there was no direct connection available to interact with the multiple Services,
whereas Microsoft Flow helps you to connect with the multiple Services easily by doing the
minimal configuration.

For example, you can create a new item in SharePoint online or SharePoint On-Premise site
whenever any post is added to your Facebook timeline. You can get the notifications, when an
event occurs and collect the data from the multiple Services. There are almost 45 Services
available with which you can connect, using Microsoft Flow. Also, you have the facility to
connect with On-Premise data such as SharePoint On-Premise or SQL database and more.

Figure1.1: Microsoft Flow

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
2
The following services are available to which you can connect, using Microsoft Flow.

Figure 1.2: Services available

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
3
2 Prerequisites

In this section, you will see the prerequisites required for getting started with Microsoft Flow.

The following prerequisites are required-

1. Microsoft flow account: Navigate to https://flow.microsoft.com and click Sign up


free in the upper-right corner.

Figure 2.1: Sign up free

2. Office 365 account. If you dont have Office 365 account, please try trial version.

3. If you want to connect to On-Premise data, then you should have an admin access to
the respective Server.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
4
3 Create a Flow from the built-in templates

There are multiple pre-defined templates available, which makes you to save time and simplify
your work life by connecting your favourite Services in a flow. It allows you to explore the
templates, based on the category, as shown in Fig 3.1. Click here to find more pre-defined
templates.

Figure 3.1: Pre-defined templates

3.1 Send a customized email when a new SharePoint list item is added

In this section, you will learn how to send a customized Email, when a new SharePoint list item
is added.

Steps Involved-

a) Navigate to your Office 365 SharePoint SiteFor example-


https://c986.sharepoint.com/sites/Vijai/

b) Navigate to the custom list. Make sure you have enabled new experience for the
custom list. Please refer to enable or disable new experience for custom list. By
default, Flow is enabled for the modern lists in Office 365 SharePoint sites.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
5
Figure 3.1.1: Custom List

c) Click Flow and subsequently click Create a flow, as shown in Fig 3.1.2.

Figure 3.1.2: Flow

d) On the right hand side, you can see the list of templates available. Click Send a
customized email when a new SharePoint list item is added template.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
6
Figure 3.1.3: Select the template

e) This template will send a customized Email to Office 365 users and Office 365
Outlook, when a new item is added to the list. Click Use this template.

Figure 3.1.4: Use this template

f) To use this template, verify Office 365 Users, Office 365 Outlook and SharePoint
accounts. If required, you can switch the accounts. Once the accounts are verified,
click Continue.
2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
7
Figure 3.1.5: Verify accounts

g) This Flow template consists of 3 predefined actions, which are shown in Fig 3.1.6.

Figure 3.1.6: Predefined actions

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
8
h) When an item is created- Site URLandList name are already prepopulated and you
no need to change this configuration. For advanced options, click Show advanced
options.

Figure 3.1.7: When an item creates an action

Figure 3.1.8: Advanced options

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
9
i) Get my profile- This action doesnt accept the inputs. This can be used in the next
step to insert the data such as Email, given name and nickname etc.

Figure 3.1.9: Get my profile action

j) Send Email- By default, send an Email action will have the below prepopulated
values, as shown in Fig 3.1.10. You can also insert the data from the previous step
and as shown in Fig 3.1.11. You can also configure the Email To, Subject and Body.

Figure 3.1.10: Send Email action

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
10

Figure 3.1.11: Send Email action Insert Data

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
11
k) For more options, you can click Show advanced options.

Figure 3.1.12: Send Email action Advanced Options

l) Click Create Flow.

Figure 3.1.13: Create Flow

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
12
m) Click Done.

Figure 3.1.14: Flow Created

n) Flow created successfully and you can see all the Flows created by you in My Flows
page.

Figure 3.1.15: My Flows

o) Navigate to the custom list and click New.

Figure 3.1.16: Custom List

p) In the new form, enter the title and click Save.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
13
Figure 3.1.17: Create Item

q) Item created successfully.

Figure 3.1.18: New Item Created

r) You will receive an Email to your Office 365 Outlook account and it looks, as shown
in Fig. 3.1.19.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
14
Figure 3.1.19: Custom email

Result

Thus, in this section, you saw how to send a customized Email to Office 365 Outlook, when a
new SharePoint list item is added.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
15
3.2 When an item in a SharePoint list is modified, send an Email

In this section, you will learn how to send an email when an item is modified in a SharePoint list.

Steps Involved-

a) Navigate to your Office 365 SharePoint Site For example-


https://c986.sharepoint.com/sites/Vijai/

b) Navigate to the custom list. Make sure, you have enabled new experience for the
custom list. Please refer to enable or disable new experience for the custom list.

Figure 3.2.1: Custom List

c) Click Flow and subsequently click Create a flow, as shown in Figure 3.2.2.

Figure 3.2.2: Flow

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
16
d) On the right hand side, you can see the list of the templates available. Scroll down to
the bottom and subsequently click See more templates.

Figure 3.2.3: More templates

e) Click When an item in a SharePoint list is modified, send an email template.

Figure 3.2.4: Select the template

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
17
f) This template will send a customized Email to Office 365 Outlook, whenever an item
is modified in the list. Click Use this template.

Figure 3.2.5: Use this template

g) To use this template, verify Office 365 Outlook and SharePoint accounts. If required,
you can switch the accounts. Once the accounts are verified, click Continue.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
18
Figure 3.2.6: Validate accounts

h) This Flow template consists of 2 predefined actions, as shown in Fig 3.2.7.

Figure 3.2.7: Predefined actions

i) When an existing item is modified- Enter the site URL and select the List name from
the drop down. For advanced options, click Show advanced options.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
19
Figure 3.2.8: When an existing item is modified

j) Send Email- By default; send an Email action will have subject and an Email body
with the prepopulated values, as shown in Fig 3.2.9. Enter the value for To with an
Email ID. For more options, click Show advanced options.

Figure 3.2.9: Send Email action

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
20
k) Click Create Flow.

Figure 3.2.10: Create Flow

l) Click Done.

Figure 3.2.11: Flow Created

m) Flow created successfully and you can see all the flows created by you in My Flows
page.

Figure 3.2.12: My Flows

n) Navigate to the custom list, select an item and click for more actions menu.
Click Edit.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
21
Figure 3.2.13: Edit list item

o) In the edit form, update the title and then click Save.

Figure 3.2.14: Edit list item

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
22
p) You will receive an Email to your Office 365 Outlook account and it looks, as shown
in Fig 3.2.15.

Figure 3.2.15: Custom Email

Result

Thus, in this section, you saw how to send a customized Email to Office 365 Outlook, when an
item is modified in SharePoint list.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
23
3.3 Save my Email attachments to a SharePoint document library

In this section, you will learn how to save Office 365 Email attachments to a SharePoint
document library.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from the template.

Figure 3.3.1: Create from template

c) Search for SharePoint and click Save my email attachments to a SharePoint


document library template.

Figure 3.3.2: Select template

d) This template will save Office 365 Outlook Email attachments to a SharePoint
document library. Click Use this template.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
24
Figure 3.3.3: Use this template

e) To use this template, verify Office 365 Outlook and SharePoint accounts. If required,
you can switch the accounts. Once the accounts are verified, click Continue.

Figure 3.3.4: Validate accounts

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
25
f) This flow template consists of 2 predefined actions, as shown in Fig 3.3.5.

Figure 3.3.5: Predefined actions

g) On new Email-By default, inbox folder will be used to retrieve the Emails. You can
also specify the folder from where you need to retrieve the Emails. For more options,
click Show advanced options.

Figure 3.3.6: On new email

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
26
Figure 3.3.7: Advanced options

h) Create Email- Enter the site URL, select the folder in which you want to save the
Email attachments. Here, I have selected Shared Documents folder.

Figure 3.3.8: Create File

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
27
i) You can configure the File name and content by clicking Edit link.

Figure 3.3.9: Edit parameters

Figure 3.3.10: Edit parameters

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
28
j) Click Create Flow.

Figure 3.3.11: Create Flow

k) Click Done.

Figure 3.3.12: Flow Created

l) Flow created successfully and you can see all the Flows created by you in My Flows
page.

Figure 3.3.13: My Flows

m) When you receive any Email in Office 365 Outlook inbox folder and if the Email
contains the attachments, the attachments are uploaded to the document library. I
have selected the folder path as Shared Documents, so all the email attachments will
be created in Shared Documents library, as shown in Fig 3.3.15.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
29
Figure 3.3.14: Office 365 Outlook email with attachments

Figure 3.3.15: Attachments saved to Shared Documents library

Result

Thus, in this section, you saw how to save Office 365Email attachments to a SharePoint
document library.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
30
3.4 Send me an Email when a new file is added in SharePoint Online

In this section, you will learn how to send me an Email, when a new file is added in SharePoint
Online.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from template.

Figure 3.4.1: Create from template

c) Search for SharePoint and click Send me an Email when a new file is added in
SharePoint Online template.

Figure 3.4.2: Select template

d) This template will send an Email to Office 365 Outlook, when a new file is added in
SharePoint online. Click Use this template.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
31
Figure 3.4.3: Use this template

e) To use this template, verify Office 365 Outlook, Office 365 Users and SharePoint
accounts. If required, you can switch the accounts. Once the accounts are verified,
click Continue.

Figure 3.4.4: Validate accounts

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
32
f) This Flow template consists of the 3 predefined actions, as shown in Fig 3.4.5.

Figure 3.4.5: Predefined actions

g) When a file is created- Enter the site URL and select the folder. Here, I have selected
Shared Documents folder. When a file is added to Shared Documents folder, an
Email will be sent to Office 365 Outlook.

Figure 3.4.6: When a file is created

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
33
h) Get my profile- This action doesnt accept the inputs. This can be used in the next
step to insert the data such as Email, Given Name and Nickname etc.

Figure 3.4.7: Get my profile

i) Send Email- By default; send an Email action, which will have the prepopulated
values, as shown in Fig 3.4.8. If required, you can insert the data from the previous
step and also you can configure the Email To, Subject and Body.

Figure 3.4.8: Send Email Edit parameters

j) Click Create Flow .

Figure 3.4.9: Create Flow

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
34
k) Click Done.

Figure 3.4.10: Flow Created

l) Flow created successfully and you can see all the Flows created by you in My Flows
page.

Figure 3.4.11: My Flows

m) Upload a document to Shared Documents. After few seconds, you will receive an
Email, as shown in Fig 3.4.13.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
35
Figure 3.4.12: Upload a document to Shared Documents

Figure 3.4.13: Office 365 Outlook email

Result

Thus, in this section, you saw how to send an Email, when a new file is added in SharePoint
Online.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
36
3.5 Save tweets to a SharePoint list

In this section, you will learn how to save the tweets to a SharePoint list.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from template.

Figure 3.5.1: Create from template

c) Search for SharePoint and click Save tweets to a SharePoint list template.

Figure 3.5.2: Select template

d) This template will save the tweets to a SharePoint list. Click Use this template.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
37
Figure 3.5.3: Use this template

e) To use this template, verify SharePoint and Twitter accounts. If required, you can
switch the accounts. Once the accounts are verified, click Continue.

Figure 3.5.4: Validate accounts

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
38
f) This Flow template consists of 2 predefined actions, as shown in Fig 3.5.5.

Figure 3.4.5: Predefined actions

g) When a new tweet appears- Enter the tweet search text.

Figure 3.5.6: When a new tweet appears

h) Create item- Enter the site URL and list the name in which you want to save the
tweets.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
39
Figure 3.5.7: Create item

i) Click Create Flow.

Figure 3.5.8: Create Flow

j) Click Done.

Figure 3.5.9: Flow Created

k) Flow created successfully and you can see all the flows created by you are in My
Flows page.

Figure 3.5.10: My Flows

l) Tweet something, which contains the text SharePoint and you can see those tweets,
which are saved to SharePoint list, as shown in Fig 3.5.11.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
40
Figure 3.5.11: Save tweets to SharePoint list

Result

Thus, in this section, you saw how to save the tweets to a SharePoint list.

3.6 Save updates from Facebook to a SharePoint List

In this section, you will learn how to save the updates from Facebook to a SharePoint list.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from template.

Figure 3.6.1: Create from template

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
41
c) Search for SharePoint and then select Social Media from drop down list. Click
Save updates from Facebook to a SharePoint List template.

Figure 3.6.2: Select template

d) This template will save the updates from Facebook to a SharePoint list. Click Use
this template.

Figure 3.6.3: Use this template

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
42
e) To use this template, verify SharePoint and Facebook accounts. If required, you can
switch the accounts. Once the accounts are verified, click Continue.

Figure 3.6.4: Validate accounts

f) This Flow template consists of 2 predefined actions, as shown in Fig 3.6.5.

Figure 3.6.5: Predefined actions

g) When there is a new post on my timeline-This operation has no inputs.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
43
Figure 3.6.6: When there is a new post on my timeline

h) Create item- Enter the site URL and list name in which you want to save Facebook
posts.

Figure 3.6.7: Create item

i) Click Create Flow.

Figure 3.6.8: Create Flow


j) Click Done.

Figure 3.6.9: Flow Created

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
44
k) Flow created successfully and you can see all the Flows created by you are in My
Flows page.

l) You can save Facebook posts to the specified SharePoint list successfully.

Figure 3.6.11: Save FB posts to SharePoint list

Result

Thus, in this section, you saw how to save the updates from Facebook to a SharePoint List.

3.7 Send SharePoint list items for an Email approval

In this section, you will learn how to send SharePoint list items for an Email approval.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from template.

Figure 3.7.1: Create from template

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
45
c) Search for SharePoint and then click Send SharePoint list items for email approval
template.

Figure 3.7.2: Select template

d) This template will send SharePoint list items for an Email approval. Click Use this
template.

Figure 3.7.3: Use this template


2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
46
e) To use this template, verify SharePoint and Office 365 Outlook accounts. If required,
you can switch the accounts. Once the accounts are verified, click Continue.

Figure 3.7.4: Validate accounts

f) This Flow template consists of the 3 predefined actions and 1 condition, as shown in
Fig 3.7.5.

Figure 3.7.5: Predefined actions

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
47
g) When a new item is created-Enter the site URL and list name for which you need to
send an Email for the approvals.

Figure 3.7.6: When a new item is created

h) Send an approval Email- Enter the value for To field and if required, you can
update the other fields.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
48
Figure 3.7.7: Send approval email

i) Condition-

Figure 3.7.8: Condition

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
49
j) Send an Email- If the approver approves the item then an Email will be sent else
does nothing. You can configure the send Email action.

Figure 3.7.9: Send email

k) Click Create Flow.

Figure 3.7.10: Create Flow


l) Click Done.

Figure 3.7.11: Flow Created

m) Flow created successfully and you can see all the Flows are created in My Flows
page.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
50
Figure 3.7.12: My Flows

n) Create an item in the list, which you have selected in When a new item is created
action.

Figure 3.7.13: Create item

o) After few minutes, the approver will receive an Email, as shown in Fig 3.7.14.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
51
Figure 3.7.14: Approval an Email

p) Once you click approve button, you will get the confirmation message, as shown in
Fig 3.7.15.

Figure 3.7.15: Confirmation message

q) After few minutes, the created item will receive an Email notification.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
52
Figure 3.7.16: Approved email

Result

Thus, in this section, you saw how to send SharePoint list items for an Email approval.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
53
4 Create a Flow from blank

In this section, you will learn how to create a Flow from scratch.

4.1 Post to my Facebook timeline, when a new item is created in a SharePoint list

In this section, you will learn how to post to my Facebook timeline, when a new item is created
in a SharePoint list.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from blank.

Figure 4.1.1: Create from blank

c) Search for SharePoint and click Sharepoint When a new item is created.

Figure 4.1.2: Search for SharePoint actions

d) When a new item is created- Enter the site URL and the list name. The items created
in this list will be posted to my Facebook timeline.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
54
Figure 4.1.3: When a new item is created

e) Click New step and click Add an action.

Figure 4.1.4: Add an action

f) Search for Facebook and click Facebook Post to my timeline.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
55
Figure 4.1.5: Search for Facebook actions

g) Post to my timeline- Configure the Status message, as shown in Fig 4.1.6.

Figure 4.1.6: Post to my timeline

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
56
h) Enter the Flow name and click Create flow.

Figure 4.1.7: Create a Flow

i) Click Done.

Figure 4.1.8: Create a Flow

j) Flow is created successfully and you will get an option to submit your Flow template
to the Microsoft Flow gallery, so that other users can create their own Flows from
your template, as shown in Fig 4.1.9. Click Submit to gallery. You cannot publish a
template, which uses a Custom API.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
57
Figure 4.1.9: Submit to gallery

k) Enter the title and description for the template and click Submit.

Figure 4.1.10: Submit to gallery

l) Create a new item in the list, as shown in Fig 4.1.11.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
58
Figure 4.1.11: SharePoint list item created

m) After few minutes, the item will be posted to your Facebook timeline.

Figure 4.1.12: SharePoint list item posted to my Facebook timeline.

Result

Thus, in this section, you saw how to post to my Facebook timeline, when a new item is created
in a SharePoint list.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
59
4.2 Post to Facebook or Twitter based on Condition when SharePoint list item is created

In this section, you will learn how to post to Facebook or Twitter, based on the condition, when a
new item is created in a SharePoint list.

Flow Design

When a new item is created, based on Post To choice value, it will be posted to Facebook or
Twitter.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows.

b) Click Create from blank.

Figure 4.2.1: Create from blank

c) Search for SharePoint and click Sharepoint When a new item is created.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
60
Figure 4.2.2: Search for SharePoint actions

d) When a new item is created- Enter the site URL and the list name. The items created
in this list will be posted to Facebook or Twitter.

Figure 4.2.3: When a new item is created

e) Click New step and click Add a condition.

Figure 4.2.4: Add a condition

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
61
f) Set the condition as Post To Value is equal to Twitter, as shown in Fig 4.2.5. If
the condition is satisfied, you will post the newly created item as a tweet in Twitter.
Under IF YES, DO NOTHING section, click Add an action.

Figure 4.2.5: Set the condition

g) Search for Twitter and click Twitter Post a tweet action.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
62
Figure 4.2.6: Add an action

h) Set the item title as tweet text, as shown in Fig 4.2.7.

Figure 4.2.7: Post a tweet

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
63
i) Under IF NO, DO NOTHING section, click Add an action.

Figure 4.2.8: Add an action

j) Search for Facebook and click Facebook Post to my timeline action.

Figure 4.2.9: Add an action

k) Set the item title as Facebook Status message, as shown in Fig 4.2.10.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
64
Figure 4.2.10: Post to my timeline

l) Enter the flow name and click Create flow.

Figure 4.2.11: Create flow

m) Click Done.

Figure 4.2.11: Flow created

n) Flow is created successfully and you will get an option to submit the template to the
gallery, as shown in Fig 4.2.12. Click Submit to gallery.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
65
Figure 4.2.12: Submit to gallery

o) Enter the title and description for the template and click Submit.

p) You can see the newly created flow in My Flows page.

Figure 4.2.13: My Flows

q) Create a new item in the custom list, as shown in Fig 4.2.14.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
66
Figure 4.2.14: Create a new item

r) Since you have selected Post To as Facebook, after few minutes, the item will be
posted to your Facebook timeline.

Figure 4.2.15: SharePoint list item posted to my Facebook timeline.

s) Create a new item in the custom list, as shown in Fig 4.2.16.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
67
Figure 4.2.16: Create a new item

t) Since you have selected Post To as Twitter, after few minutes, the item will be
tweeted to your Twitter.

Figure 4.2.17: Share Point list item tweeted to my twitter

Result

Thus, in this section, you saw how to post to Facebook or Twitter, based on the condition, when
a new item is created in a SharePoint list.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
68
5 Manage Flows

In this section, you will learn how to manage the Flows created by you.

5.1 My Flows Page

In this section, you will see all the Flows created by you in My Flows page.

Steps Involved are-

a) Navigate to Flows home page https://flow.microsoft.com/

b) In the top navigation, click My Flows.

Figure 5.1.1: My Flows Page

c) You can see all the Flows, which you have created in My Flows page. You can
manage your Flow from this page. Also, you will see an option to create the Flow
from the template or blank.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
69
Figure 5.1.2: My Flows

5.2 Turn on/off the Flow

In this section, you will learn how to turn on or off the Flow.

Steps Involved are-

a) Navigate to My Flows page https://flow.microsoft.com/manage/flows

b) You can turn on/off the Flow, as shown in Fig 5.2.1.

Figure 5.2.1: Turn off the Flow

c) When you turn off, Flow will be disabled and it will not be executed.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
70
5.3 Edit/update the Flow

In this section, you will learn how to edit or update the Flow.

Steps Involved

a) Navigate to MyFlows page https://flow.microsoft.com/manage/flows.

b) Select the Flow, which you want to edit and click Edit, as shown in Fig 5.3.1.

Figure 5.3.1: Edit your flow

c) Do the changes and click Update flow.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
71
Figure 5.3.2: Update the Flow

d) Your Flow was updated. To close, click Done.

Figure 5.3.3: Close the Flow

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
72
5.4 Delete the flow

In this section, you will learn how to delete the Flow.

Steps Involved are-

a) Navigate to MyFlows page https://flow.microsoft.com/manage/flows.

b) Select the Flow, which you want to delete and click Delete, as shown in Fig 5.4.1.

Figure 5.4.1: Delete the flow

c) Confirm the deletion by clicking OK.

Figure 5.4.2: Delete the flow

d) Flow is deleted successfully.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
73
5.5 Flow History

In this section, you will learn how to view the Flow history.

Steps Involved are-

a) Navigate to MyFlows page https://flow.microsoft.com/manage/flows.

b) Select the Flow for which you want to see the history and then click the information
icon, as shown in Fig 5.5.1.

Figure 5.5.1: Flow Information

c) You can see the complete Flow run history and also you can filter by
Successes/Failures, as shown in Fig 5.5.2.

Figure 5.5.2: Flow History

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
74
6 Manage Connections

Connections in Microsoft Flow allow you to easily access your data while building Flows. Flow
includes commonly used connections, including SharePoint, SQL, Office 365, OneDrive for
Business, Salesforce, Excel, Dropbox, Twitter and more.

6.1 My Connections Page

In this section, you will learn about My Connections page.

Steps Involved are-

a) Navigate to Flows home page https://flow.microsoft.com/

b) In the top navigation, click user icon and click My connections.

Figure 6.1.1: My Connections

c) You can see a list of connections, which you are connected to.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
75
Figure 6.1.2: My Connections

6.2 Create New Connection

In this section, you will learn how to create a new connection.

Steps Involved are-

a) Navigate to Flows home page https://flow.microsoft.com/manage/connections.

b) In My connections page, click Create connection.

Figure 6.2.1: Create new connection

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
76
c) Select the connection, where you want to create the Flow from the available
connections and click + button, as shown in Fig 6.2.2.

Figure 6.2.2: Select the connection

d) Enter your credentials to verify your account details.

Figure 6.2.3: Verify your account

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
77
e) You have successfully created new connection and it will be displayed in your My
connections page.

Figure 6.2.4: Connection created

6.3 Connect via on-premise data gateway

In this section, you will learn how to connect to SharePoint 2016, via On-Premise data gateway.

Steps Involved are-

a) Navigate to Flows home page https://flow.microsoft.com/manage/connections.

b) In My connections page, click Create connection.

Figure 6.3.1: Create new connection

c) Select SharePoint and click + button, as shown in Fig 6.3.2.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
78
Figure 6.3.2: Available connections

d) Select Connect via on-premise data gateway. Select authentication type as


Windows, enter the username and password, which you have used to register the
gateway. Select the gateway, which you have created for; On-Premise and then click
Create Connection.

Figure 6.3.3: Create connection

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
79
e) On-Premise connection is created successfully, which can be used in creating the
Flow.

Figure 6.3.4: Connection created

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
80
6.4 Delete connection

In this section, you will learn how to delete a connection.

Steps Involved are-

a) Navigate to Flows home page https://flow.microsoft.com/manage/connections.

b) In My connections page, select the connection, which you have want to delete and
click Delete, as shown in Fig 6.4.1.

Figure 6.4.1: Delete a connection

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
81
7 Manage gateways

Install and manage an On-Premises data gateway to securely integrate a variety of Cloud-based
apps with your On-Premise data and Applications through Microsoft Flow.

7.1 Install and Manage on-premise data gateway

In this section, you will learn how to install and manage On-Premise data gateway. I have a
SharePoint 2016 On-Premise Beta environment in Cloudshare and I am going to install gateway
in that environment. Once the gateway is installed and configured, the gateway is created
successfully to connect with SharePoint On-Premise.

Figure 7.1.1: Cloudshare Environment - SharePoint 2016 On-Premise

Steps Involved are-

a) Go to SharePoint 2016 Beta environment in Cloudshare.


b) Navigate to Flows home page https://flow.microsoft.com.
c) In the top navigation, click user icon and then click My gateways.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
82
Figure 7.1.2: My gateways

d) In My gateways page, click Create gateway.

Figure 7.1.3: Create gateway

e) Once the GatewayInstall.exe is downloaded, open the exe file.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
83
Figure 7.1.4: Open GatewayInstall.exe

f) Click Run.

Figure 7.1.5: Run GatewayInstall.exe

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
84
g) Click Next.

Figure 7.1.6: Install Gateway

h) Select the path, where you want to install the gateway and accept the terms of use
and privacy statement. Click Install.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
85
Figure 7.1.7: Install Gateway

i) Installation is in progress.

Figure 7.1.8: Install gateway

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
86
j) Installation is completed. Now, you have to sign in to register your gateway. Click
Sign in.

Figure 7.1.9: Register your gateway

k) Enter the Email address of the account, you want to sign in with and click Continue.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
87
Figure 7.1.10: Sign in to your account

l) Enter your password and click Sign in.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
88
Figure 7.1.11: Sign in to your account

m) Select Register a new gateway on this computer and click Next.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
89
Figure 7.1.12: Register a new gateway

n) Enter gateway name and the recovery key. Click Configure.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
90
Figure 7.1.13: Register a new gateway

o) Your gateway is registered successfully, as shown in Fig 7.1.14.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
91
Figure 7.1.14: New gateway registered successfully

p) In the Windows Services, you can see a new Service is created for On -Premise data
gateway, as shown in Fig 7.1.15.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
92
Figure 7.1.15: On-Premise data gateway service

q) You can see a new gateway is created in My gateways page, as shown in Fig 7.1.16.

Figure 7.1.16: New gateway created

Result

Thus, in this section, you saw how to install and manage On-Premise data gateway.

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.
93
Reference

https://flow.microsoft.com/

Summary

In this book, we covered nearly all the basics, which can be performed with Microsoft Flow.
This book is only the beginning. There are many things, which can be done and now, you are
ready to develop the advanced solutions with Microsoft Flow.

Thanks for Reading!!!!!!!

2016 C# CORNER.
SHARE THIS DOCUMENT AS IT IS. PLEASE DO NOT REPRODUCE, REPUBLISH, CHANGE OR COPY.

You might also like