Master Microsoft Flow Tips and Tricks

Tips & Tricks
with MS Flow
Microsoft Flow
John Calladine
About JohnC
John is an IT Pro with nearly 30 years’ experience in the Microsoft
technology space.
Originally from England, he’s been in Boston for over twenty years. 
J
o
h
n
 
s
e
t
 
u
p
 
h
i
s
 
o
w
n
 
c
o
n
s
u
l
t
i
n
g
 
c
o
m
p
a
n
y
 
J
C
P
C
 
C
o
n
s
u
l
t
i
n
g
 
l
l
c
.
b
a
c
k
 
i
n
 
2
0
1
4
,
 
a
n
d
 
s
p
e
c
i
a
l
i
z
e
s
 
i
n
 
O
f
f
i
c
e
 
3
6
5
 
a
n
d
 
S
h
a
r
e
P
o
i
n
t
a
r
c
h
i
t
e
c
t
u
r
e
.
 
 
C
o
m
p
a
n
y
 
w
e
b
s
i
t
e
 
w
w
w
.
j
c
a
l
l
a
d
i
n
e
.
n
e
t
Outside work, John is a triathlete, keen skier, wine teacher
and bon vivant.
 
Email
:  
john@jcalladine.net
Agenda
This session includes a deep introduction to Flow
and some “
almost programmy
” ways to get it to work for you.
Regular stuff
1.
Microsoft Flow Basics
2.
Trigger off a SharePoint list
3.
Dealing with Loops and Conditions
4.
Having fun with Expressions
More Advanced Stuff
5.
Nested trigger off a PowerApps
6.
Using variables, arrays and structures to create objects
7.
Pass objects across a Flow to launch web requests or other flows
8.
Tips and tricks for maintenance and moving Flows between sites/tenants.
 
Who has used Flow?
Audience Poll
 
Who claims to have programmed?
1. MS Flow Basics
Kick-off using 
Triggers
“Events”
Design you flows based on 
Actions
Changes to the underlying data source
 
Office 365
MS Flow “free” license
Premium license
P1   ($5 per user per month)
P2   ($15 per user per month)
 
What you Need to Get Started
750 
individual
 runs per user per month
- Free license.
50,000 
total
 runs
You can pay $5/m for overage
 
What are the Limits  -  Currently
TRICK
 Don’t use IE to 
design
 flows
1. MS Flow Connects to 
many
 Data Sources
200+ included
~50 premium  (P1/ P2 license)
Not Just Office 365 products!
TRICK
Use the Free version!
Unless you need premium
https://flow.microsoft.com/en-us/connectors/
 
2. Useful Triggers
Flow Button for Mobile
PowerApps
Type 
Button
 in the search
2. Trigger off a SharePoint list
When a new item is created in a SharePoint list
Fires off the trigger, which Flow can detect
1.
Connect to the data source
2.
Configure the trigger
3.
Add some actions
GET STARTED       
https://us.flow.microsoft.com
2. You can see the Dynamic Data
 
Every data source exposes its data in
the 
Dynamic Content 
:
Lists all the data elements in the SP List
Demo 1 SharePoint list is On Boarding
Don’t see
everything?
See more
Demos 1 & 2
Taking some actions when a user has added a new item to SharePoint list
Tricks – Improve Emails with HTML tags
Switch On HTML
Test Your
Flows by
re-using Data
Tricks to Get Started
Click the Flow icon on the App Launcher in O365!
Use a template , or start from scratch
Use an HTML 5 browser (Chrome or Firefox)
Make a data 
Connection
Choose one 
Trigger
Start adding your 
Actions
Name 
every Step  by changing the LABEL before
anything else!
QUICK TIP: launch from any SP Modern List
3. Dealing with Loops & Conditions
 
Loops
 are iteration over a group (Collection) of objects
Apply to Each 
Object
 in Collection Of Objects
Then you deal with each 
Object
 in turn
 
Eh?
 
Say you have a group of users you email
You want each user to receive an individual email
Time for a Loop!
3. Loop Types in MS Flow
Apply to Each
Iterate over Objects in a Collection
Apply to Each Object in
[Container of Objects]
Do Until
Loop until a condition is met
DANGEROUS! when not met…
TIP
Set an iteration max
3. Dealing with Conditions
 
Condition
 are a switch between two alternatives
IF (Test for True) Then Action1 Else Action2
If Then Else
If This then That
 
If the User lives in MA Then
Invite them to a party in Boston
Else
Invite them to NYC
Switch Between 
Choices
 
(Choice1) Then Action1
 
(Choice2) Then Action2
 
(Choice3) Then Action3
 
(Default) Then ActionDefault
 
 
Multiple Choices are a SWITCH
3. Branch Types in Flow
Condition
Switch
Example Condition
Demo 3 Weather
If you live in the US
Show units Imperial
Else
Show units Metric
Download the App for your Phone
Demos 3
Dealing with Loops and Conditions
Tips with Loops &
Conditions
For Each appears automatically for Grouped data
Conditions
 are Case Sensitive
Every 
If
 
(Yes) must have an 
Else
 
(No) action
Always add a 
Default Action 
for choices
Start to add Scopes where multiple actions involved
Label
 your Scope
Make sure your loop can finish!
4. Having fun with Expressions
 
Expression
 – methods to change data to fit your needs
Think Excel FUNCTIONS
 
Change a US Date into something rest of the World can understand
So what does the following mean:
 4/1/18 ?
4
th
 of January 2018 for Europe
 
Flow comes with an 
Expression Builder
!
formatDateTime( 
utcNow()
, "dd-MMM-yy")
1-Apr-2018
Custom date-and-time format strings
4. Expressions You’ll Want
convertTimeZone
( utcNow(), 'UTC', 'Eastern Standard Time', 'g')
formatDateTime
( utcNow(), 
'
dd-MMM-yyyy
'
)
addDays
(triggerBody()?['HireDate'], 7 )
<a href=‘mailto:[email address]’> [display name]</a>
Changing Date Displays
Create a Mail Link
4. TIP: Design Conditions in Pseudo Code
Write it in Pseudo Code first:
Becomes: 
Attempt 1
    
Attempt 2
if [HireDate]  less than today
 
add 7 days to today
else
 
add 7 days to [HireDate]
 
if( 
less
(triggerBody()?['HireDate'], utcNow() ),
    
addDays
( utcNow(),7)
,
    
addDays
(triggerBody()?['HireDate'],7)  )
Demos 4
Fun with Expressions
Expression Tips
There 
are
 Case Sensitive
Every
  
(
   
must have a  
)
Strings must be in   
'
 
single quotes 
'
 
Think Symmetry!
Keep testing them out in Emails
Use the More button
Think Negatively!  - for conditional testing
When Content is Null (means there’s nothing – useful test)
Use Pseudo code to design your expressions
More Expressions Tips
Try simple ones, first!
Test using Email
KEEP ON  TRYING to refine
(sounds like a loop to me)
Hit the 
See more
There are no Spaces in functions
More Advanced Stuff
We are all programmers!
But First a Diversion...
 
How do you think your
 Work Flow should work?
What is the business process
you are emulating?
How do you get started?
Time to Design Your Work Flow
Design your Flows on Paper First
TIP
Or use Visio
Example Real
Flow Design
FINSIHED
MS Flow
Document Approval
Legal Review
Get Signatures
5. Trigger Flow off a PowerApps
PowerApps
upgrade on InfoPath
Form or App generator tool
“Free” with Office 365
 
User presses a button on
PowerApps form to start a Flow
Sounds like a trigger to me!
Demos 5
Triggers from PowerApps.
Passing data from PowerApps to Flow.
5. Nested Trigger off a PowerApps
Pass data from PowerApps to Flow
1.
Create a Form
1.
Text box     [Strings]
2.
Drop downs  [Choices
3.
Check boxes  [Yes/ No]
4.
Button to be the action item
2.
Be proactive to 
name
 each element
3.
On the Action for the button
connect to the Flow
User enters some data into the
form and we use it in Flow
Now we can use that data inside
the flow and store it somewhere
Tricks with
PowerApps
Use PowerApps straight from SharePoint
Modern Lists and Doc Libraries only
Add a Button and Text box
Name
 them
Button action to connect with  a Flow
No spaces in object names.
Use prefixes e.g.  txtInput,  cmdButton
Full On
Boarding
Flow
6. DEFINITIONS: Variables, Arrays, Objects
Variable
 – information stored in a named bucket
Array
 – a group of objects stored
             in labelled cubby hole
Object
 – something with lots of information
1
2
3
4
5
6
6. Using Variables, Arrays & Objects
Add a Variable to a Flow (Initialize)
1.
Give it a 
Name
Don’t use Spaces
2.
Choose the data type
Boolean
Integer
Float
String
Object
Array
 
3.
Assign an initial 
Value
TIP
You can only add
Variables at the
Start
, after Trigger
BONUS
Change this label
6. Variables
Hang on,
I didn’t see a 
Date
 in the
variables….
Use a 
Float
 !
Dates are actually the number of
days since T
0
 ,and below the
decimal is fractions of the day
1893.37619
6. Working with Variables
TIP
Initialize
comes First
Initialize
Then Set/ Add or Decrease
What you Can Do
Demos 6
Using Variables
Understanding Arrays
Creating Objects
Tips with Variables
Name each variable
Don’t use Spaces
Assign a data type
Give it an initial value
BONUS -  label the variable too !
Variables MUST be declared at Top of Flow
Dates are stored as FLOAT
Use the INITIALIZE VARIABLE to create a new one
Use the SET VARIABLE action to change  a variable
6a. JSON Notation
Now we are getting 
programmy
!
JSON is simply the notation for
marking up the MS Flow
Bit like XML
but with { and :
Instead of < and =
Sometimes we HAVE to edit it
And we need it to create 
objects
 "When_an_item_is_created": {
          "recurrence": {
            "interval": 5,
            "frequency": "Minute"
          },
          "splitOn": "@triggerBody()?['value']",
          "metadata": { "flowSystemMetadata": { "swaggerOperationId": "GetOnNewItems" }
},
          "type": "ApiConnection",
          "inputs": {
            "host": {
              "api": { "runtimeUrl": "https://msmanaged-na.azure-
apim.net/apim/sharepointonline" },
              "connection": { "name":
"@parameters('$connections')['shared_sharepointonline']['connectionId']" }
            },
            "method": "get",
            "path":
"/datasets/@{encodeURIComponent(encodeURIComponent('https://XXX.sharepoint.co
m/sites/documents'))}/tables/@{encodeURIComponent(encodeURIComponent('157b8b
37-c931-4f13-ad47-51a5a0daa734'))}/onnewitems",
            "authentication": "@parameters('$authentication')"
          }
        }
Tips with Arrays &
Objects
Arrays start counting at 0
To add an item use the
Append to Array 
action
Objects are stored in JSON
7. Pass objects across a Flow to launch
    web requests or other flows
 
Demos 7
Pass objects across a Flow
Launch  web requests or other flows
8. Tips and Tricks for Maintenance
1.
Be generous and Share your flow
Add users and other owners to your flow
2.
Even though you ARE a citizen developer,
Flows run under YOUR account
3.
Rename flow and provided meaningful
descriptions to fit the purpose
4.
Save Flow as Template
5.
xxx
 & Moving Flows between sites/tenants
TIP
Ask admins for generic
account, and port to that user
TIP
Let others re-use
your flow
8. Debug Flows
You Can’t Debug a Flow 
But you can view flow history
Inspect each step
Look at the values
Evaluate the broken steps in
Red
Demos 8
Maintaining Flows,
Moving between Tenants,
Debugging
Other Tips & Tricks
SharePoint Lists
Avoid putting spaces in column and library names.
Can change display after creation otherwise, 
_x20_ 
appears for the space.
SocialGroup  
 Social Groups
MeetingDate 
 Meeting Date
Everything Revolves
Around Flow!
Office 365 “secret” tool
to help citizens programmers
build useful business workflows
 
                 GO BUILD ONE TODAY!
More Information on MS Flow
Flow Licensing
Overview & Demo 
(YouTube: 45 mins)
Automating your Tasks with Flow
  (slide show)
Expressions & How to Use Them
Custom date-and-time format strings
How to convert string datetime data-types
Patterns for handling Flow Errors
Hidden Gems
Don’t do it this way
Use formatDateTime( ‘MM/d/yy’)
Slide Note
Embed
Share

Discover expert insights and practical advice on maximizing the potential of Microsoft Flow with John Calladine. Explore advanced techniques, key features, and essential strategies to streamline your workflow effectively. Uncover valuable tips for designing flows, leveraging connectors, managing data sources, and optimizing performance. Elevate your productivity with actionable guidance from a seasoned IT pro.

  • Microsoft Flow
  • Tips and Tricks
  • Automation
  • Workflow Efficiency
  • Data Integration

Uploaded on Sep 23, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Tips & Tricks with MS Flow John Calladine Microsoft Flow

  2. About JohnC John is an IT Pro with nearly 30 years experience in the Microsoft technology space. Originally from England, he s been in Boston for over twenty years. John set up his own consulting company JCPC Consulting llc. back in 2014, and specializes in Office 365 and SharePoint architecture. Company website www.jcalladine.net Outside work, John is a triathlete, keen skier, wine teacher and bon vivant. Email: john@jcalladine.net

  3. Agenda This session includes a deep introduction to Flow and some almost programmy ways to get it to work for you. Regular stuff 1. 2. 3. 4. Microsoft Flow Basics Trigger off a SharePoint list Dealing with Loops and Conditions Having fun with Expressions More Advanced Stuff 5. Nested trigger off a PowerApps 6. Using variables, arrays and structures to create objects 7. Pass objects across a Flow to launch web requests or other flows 8. Tips and tricks for maintenance and moving Flows between sites/tenants.

  4. Who has used Flow? Who claims to have programmed? Audience Poll

  5. 1. MS Flow Basics TRICK Don t use IE to design flows Kick-off using Triggers Events Design you flows based on Actions Changes to the underlying data source What you Need to Get Started Office 365 MS Flow free license Premium license P1 ($5 per user per month) P2 ($15 per user per month) What are the Limits - Currently 750 individual runs per user per month - Free license. 50,000 total runs You can pay $5/m for overage

  6. 1. MS Flow Connects to many Data Sources 200+ included ~50 premium (P1/ P2 license) TRICK Use the Free version! Unless you need premium Not Just Office 365 products! https://flow.microsoft.com/en-us/connectors/

  7. Type Button in the search 2. Useful Triggers Flow Button for Mobile PowerApps

  8. 2. Trigger off a SharePoint list When a new item is created in a SharePoint list Fires off the trigger, which Flow can detect 1. 2. 3. Connect to the data source Configure the trigger Add some actions GET STARTED https://us.flow.microsoft.com

  9. 2. You can see the Dynamic Data Every data source exposes its data in the Dynamic Content : Lists all the data elements in the SP List Demo 1 SharePoint list is On Boarding Don t see everything? See more

  10. Demos 1 & 2 Taking some actions when a user has added a new item to SharePoint list

  11. Tricks Improve Emails with HTML tags Switch On HTML

  12. Test Your Flows by re-using Data

  13. Tricks to Get Started Click the Flow icon on the App Launcher in O365! Use a template , or start from scratch Use an HTML 5 browser (Chrome or Firefox) Make a data Connection Choose one Trigger Start adding your Actions Name every Step by changing the LABEL before anything else! QUICK TIP: launch from any SP Modern List

  14. 3. Dealing with Loops & Conditions Loops are iteration over a group (Collection) of objects Apply to Each Object in Collection Of Objects Then you deal with each Object in turn Eh? Say you have a group of users you email You want each user to receive an individual email Time for a Loop!

  15. 3. Loop Types in MS Flow Do Until Loop until a condition is met DANGEROUS! when not met Apply to Each Iterate over Objects in a Collection Apply to Each Object in [Container of Objects] TIP Set an iteration max

  16. 3. Dealing with Conditions Condition are a switch between two alternatives IF (Test for True) Then Action1 Else Action2 If Then Else If This then That Multiple Choices are a SWITCH If the User lives in MA Then Invite them to a party in Boston Else Invite them to NYC Switch Between Choices (Choice1) Then Action1 (Choice2) Then Action2 (Choice3) Then Action3 (Default) Then ActionDefault

  17. 3. Branch Types in Flow Condition Switch

  18. Example Condition Demo 3 Weather If you live in the US Show units Imperial Else Show units Metric Download the App for your Phone Download the App for your Phone

  19. Demos 3 Dealing with Loops and Conditions

  20. Tips with Loops & Conditions For Each appears automatically for Grouped data Conditions are Case Sensitive Every If (Yes) must have an Else (No) action Always add a Default Action for choices Start to add Scopes where multiple actions involved Label your Scope Make sure your loop can finish!

  21. 4. Having fun with Expressions Expression methods to change data to fit your needs Think Excel FUNCTIONS Change a US Date into something rest of the World can understand So what does the following mean: 4/1/18 ? 4th of January 2018 for Europe Flow comes with an Expression Builder! formatDateTime( utcNow(), "dd-MMM-yy") 1-Apr-2018 Custom date-and-time format strings

  22. 4. Expressions Youll Want Changing Date Displays convertTimeZone( utcNow(), 'UTC', 'Eastern Standard Time', 'g') formatDateTime( utcNow(), 'dd-MMM-yyyy') addDays(triggerBody()?['HireDate'], 7 ) Create a Mail Link <a href= mailto:[email address] > [display name]</a>

  23. 4. TIP: Design Conditions in Pseudo Code Write it in Pseudo Code first: if [HireDate] less than today add 7 days to today else add 7 days to [HireDate] Becomes: Attempt 1 Attempt 2 if( less(triggerBody()?['HireDate'], utcNow() ), addDays( utcNow(),7) , addDays(triggerBody()?['HireDate'],7) ) if(triggerBody()?['HireDate'] < utcNow(), addDays( utcNow(),7) , addDays(triggerBody()?['HireDate'],7) )

  24. Demos 4 Fun with Expressions

  25. Expression Tips There are Case Sensitive Every ( must have a ) Strings must be in 'single quotes ' Think Symmetry! Keep testing them out in Emails Use the More button Think Negatively! - for conditional testing When Content is Null (means there s nothing useful test) Use Pseudo code to design your expressions

  26. More Expressions Tips Try simple ones, first! Test using Email KEEP ON TRYING to refine (sounds like a loop to me) Hit the See more There are no Spaces in functions

  27. More Advanced Stuff We are all programmers!

  28. But First a Diversion... How do you think your Work Flow should work? What is the business process you are emulating? How do you get started? Time to Design Your Work Flow

  29. Design your Flows on Paper First Submit a Request START Request Manager User Review TIP Or use Visio Approve Reject Email Approval to User Send User Rejection STOP

  30. Example Real Flow Design

  31. FINSIHED MS Flow Document Approval Legal Review Get Signatures

  32. 5. Trigger Flow off a PowerApps User presses a button on PowerApps form to start a Flow Sounds like a trigger to me! PowerApps upgrade on InfoPath Form or App generator tool Free with Office 365

  33. Demos 5 Triggers from PowerApps. Passing data from PowerApps to Flow.

  34. 5. Nested Trigger off a PowerApps Pass data from PowerApps to Flow 1. Create a Form 1. Text box [Strings] 2. Drop downs [Choices 3. Check boxes [Yes/ No] 4. Button to be the action item 2. Be proactive to name each element 3. On the Action for the button connect to the Flow User enters some data into the form and we use it in Flow Now we can use that data inside the flow and store it somewhere

  35. Tricks with PowerApps Use PowerApps straight from SharePoint Modern Lists and Doc Libraries only Add a Button and Text box Name them Button action to connect with a Flow No spaces in object names. Use prefixes e.g. txtInput, cmdButton

  36. Full On Boarding Flow

  37. 6. DEFINITIONS: Variables, Arrays, Objects Variable information stored in a named bucket Joe 1 2 3 Array a group of objects stored in labelled cubby hole 4 5 6 Object something with lots of information

  38. 6. Using Variables, Arrays & Objects BONUS Change this label Add a Variable to a Flow (Initialize) 1. Give it a Name Don t use Spaces 2. Choose the data type Boolean Integer Float String Object Array 3. Assign an initial Value TIP You can only add Variables at the Start, after Trigger

  39. 6. Variables Hang on, I didn t see a Date in the variables . Use a Float ! Dates are actually the number of days since T0 ,and below the decimal is fractions of the day 1893.37619 Data Type Examples Boolean Yes / No True / False Integer 1 / 2 / 3 Float 987.2345 String Hello World Object JSON structure - see slide 6a Array { Red , Green , Blue } { 1, 2, 3, 5, 8, 13}

  40. 6. Working with Variables TIP Initialize comes First What you Can Do Initialize Then Set/ Add or Decrease

  41. Demos 6 Using Variables Understanding Arrays Creating Objects

  42. Tips with Variables Name each variable Don t use Spaces Assign a data type Give it an initial value BONUS - label the variable too ! Variables MUST be declared at Top of Flow Dates are stored as FLOAT Use the INITIALIZE VARIABLE to create a new one Use the SET VARIABLE action to change a variable

  43. 6a. JSON Notation "When_an_item_is_created": { "recurrence": { "interval": 5, "frequency": "Minute" }, "splitOn": "@triggerBody()?['value']", "metadata": { "flowSystemMetadata": { "swaggerOperationId": "GetOnNewItems" } }, "type": "ApiConnection", "inputs": { "host": { "api": { "runtimeUrl": "https://msmanaged-na.azure- apim.net/apim/sharepointonline" }, "connection": { "name": "@parameters('$connections')['shared_sharepointonline']['connectionId']" } }, "method": "get", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://XXX.sharepoint.co m/sites/documents'))}/tables/@{encodeURIComponent(encodeURIComponent('157b8b 37-c931-4f13-ad47-51a5a0daa734'))}/onnewitems", "authentication": "@parameters('$authentication')" } } Now we are getting programmy! JSON is simply the notation for marking up the MS Flow Bit like XML but with { and : Instead of < and = Sometimes we HAVE to edit it And we need it to create objects

  44. Tips with Arrays & Objects Arrays start counting at 0 To add an item use the Append to Array action Objects are stored in JSON

  45. 8. Tips and Tricks for Maintenance & Moving Flows between sites/tenants 1. Be generous and Share your flow Add users and other owners to your flow 2. Even though you ARE a citizen developer, Flows run under YOUR account 3. Rename flow and provided meaningful descriptions to fit the purpose 4. Save Flow as Template 5. xxx TIP Ask admins for generic account, and port to that user TIP Let others re-use your flow

  46. 8. Debug Flows You Can t Debug a Flow But you can view flow history Inspect each step Look at the values Evaluate the broken steps in Red

  47. Demos 8 Maintaining Flows, Moving between Tenants, Debugging

  48. Everything Revolves Around Flow! Office 365 secret tool to help citizens programmers build useful business workflows GO BUILD ONE TODAY!

  49. More Information on MS Flow Flow Licensing Overview & Demo (YouTube: 45 mins) Automating your Tasks with Flow (slide show) Expressions & How to Use Them Custom date-and-time format strings How to convert string datetime data-types Patterns for handling Flow Errors Hidden Gems Don t do it this way Use formatDateTime( MM/d/yy )

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#