Master Microsoft Flow Tips and Tricks

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.


Uploaded on Sep 23, 2024 | 0 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. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

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