Top 25 Power Automate flow tips and tricks for 2021 - hidden gems and new features

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thanks Reza, I picked up at lot of tips there.

Half an hour well spent, keep up the great work!

👍︎︎ 2 👤︎︎ u/HengeHopper 📅︎︎ Mar 25 2021 🗫︎ replies
Captions
hello everyone this is raza dharani welcome to my channel in this video i will show you 25 power automate flow tips and tricks and features that every flowmaker needs to be aware of so ready steady let's flow out here in the flowmaker portal at flow.microsoft.com the first tip is about the different types of flows that you can create so if i head over to the create option right here on the left hand navigation you are presented with five different types of flows the first flow is called an automated cloud flow and these flows are triggered automatically based on a designated event and that event based upon the trigger action for a specific connector there are some commonly used automated cloud flow triggers that are presented right here for example microsoft forms when a user creates a new response i can trigger this flow or when an item is created in a sharepoint list or when a file is created in onedrive you can also search for a specific connector for example i can search for sharepoint and this will list out all those automated triggers related to sharepoint the second type of flow is called an instant cloud flow or a manual flow or a button flow and these flows are triggered manually the flow trigger button that you can trigger manually from your mobile device you can trigger a flow from powerapps you can call a flow from power virtual agents all of these are manual because it involves a user action so in case of powerapps i have to click a button in powerapps to call the flow in case of onedrive i have to select a file in my onedrive and start the flow the third type of flows are called scheduled cloud flows these flows will trigger based on a schedule that you define so you can run your flows monthly weekly daily you can even go down to the extent of selecting which days and at which time would you like your flow to trigger the fourth type of flow are called desktop flows and these flows can perform robotic process automation capabilities for your desktop apps or apps on the web by leveraging the flow designer which is power automate desktop once you have power automate desktop installed i can straight away go and launch the power automate desktop app and i can start creating my robotic process automation flows wherein i can record and replay my actions the fifth type of flow is known as the business process flows and these type of flows guides you through a multi-step process so you can define your flow steps as you move through a process these type of flows are tied in with microsoft dataworks formerly known as the common data service you have to have your tables created in microsoft dataworks i have to associate my business process flow with one of the tables in microsoft dataverse the second flow tip is around using templates now right here on the create experience itself there are various templates provided with different categorizations for example there are approval based templates which contains flows involving the approval action you can also search for templates i search for templates related to attachments this will light up all those templates that have been created specific to attachments in any data service sharepoint outlook are a few examples so right here i have a flow template to save my email attachments to my onedrive and if i just select this the first step is i have to connect to all the connectors that are leveraged on the flow so i need to connect to outlook and to onedrive and once i have my connections established i can just go ahead and create the flow and this flow is live and ready to go i can head over to edit and look at all the actions that this flow is presenting me as part of the template templates are extremely powerful because you don't have to reinvent the view the third tip is around creating flows when we start creating flows we need to pick the trigger or the flow type now if you're confused as to which trigger or which flow type do you need if i pick any of the first three options here let's say i pick the automated cloud flow i have an option here to skip the trigger completely so if i click skip this takes me directly to the flow creation experience and right here i'm presented with all of the connectors and these are all the connectors that allow me to connect to my data services so if i'm looking out for any sort of trigger around sharepoint i can just search for sharepoint select the sharepoint connector and here are all the triggers that are available as part of the sharepoint connector let's say i pick the connector when an item is created in sharepoint that's the trigger action that gets set up and if i would like to change this can just go to the three ellipses delete the step and once again i'm presented with options to choose any trigger of my choice the fourth tip is around the connectors now here i have a list of all the connectors and the way i can search for connectors is literally by searching for the connector name for example if i'm looking for connectors around microsoft teams if i search for microsoft teams here is the microsoft teams connector and if i select this here are all the triggers associated with this connector and here are all the actions associated with this connector you have the classification of the connectors right here so i have built-in connectors which is the flow mobile power apps power virtual agents and so and so forth i can even look at some standard connectors and standard connectors are those connectors that do not require any premium licensing costs premium connectors are connectors that require you to have a premium license custom connectors are any custom connectors that are created as part of your environment now tip number five is around renaming actions and naming your flows so here i have a flow which basically starts an approval process when an item is created in a sharepoint list and the approval action goes to the user's manager for approval these action names are the default names of those actions the best practice here is to rename those actions to the actual function that you're trying to perform so that the maintainability aspect of your flow improves so for example the action says start an approval now if i was to leave this organization and some other user was to come and take control of this approval process flow now start an approval for the user's manager now i have to open this look at the actions and understand what's going on here so best practice always rename your flow actions so i can call this start manager approval the moment you add your action go ahead and rename the action here is another example i have three send and email actions and if you look at the action name it does not give any insight as to what is the functionality behind this email action so in this case i'm sending an email for the project status report in this case there's an email for a task reminder so if you rename your flow actions to the function that the action is performing it improves the maintainability aspect of your flow also the flow itself name the flow based on the action that the flow is performing now in my case here this is my flow for power automated flow tips you can even include emojis here and then when i head over to my flows if i need to search for my flows if i've named them right i can easily search for them so if i search for tips i have a couple of flows that have the word tips in their titles the next tip is around adding commands to your actions now commands and actions can be very handy once again from a maintainability standpoint and you can also plug in the expressions if you have used those in your actions now here i have an action to get all the items from my sharepoint list now if i just purely look at this action it seems like this action will get all the data from my sharepoint list but if i go to show advanced options i notice that there's a filter query right here which says go ahead and filter the data from this data source where the due date column is less than or equal to and here's an expression if i select this it shows me the expression utc now that is today's date and time so basically get me all the items where the due date has passed had the maker of this flow just added a command here or maybe entered the actual functionality itself in the name of this action it would have been much easier to understand for example get items past due date or i can go to the three ellipses and go and add a command right here now you don't want the action names to be very large because if you use it in expressions later it might get a bit complex so keep your action name small and utilize commands to the fullest the next tip is around copying and pasting actions so every action that you add in your flow you have the option of going to three ellipses and you can straight away go and copy this action now this action that i just copied is available on my clipboard for my current browser session if i go ahead and try and insert an action again and this time head over to my clipboard i see that action available right here so i can just go ahead and paste this i can even go to a completely different flow add a new step go to my clipboard and it will be available for my browser session now if you want to use this in a flow in a different tenant or in a different browser if i just open my notepad and do a control v that's after me copying my action to my clipboard if i just do a control v i get the code behind that action and i can go ahead and save this so here's me accessing a flow by refreshing my browser cache if i go to new step in my clipboard don't see my clipboard content that i had copied however now if i go back to that notepad and just copy this come right here just click here and ctrl v it will paste that action right here you can use this for sharing flow snippets the next tip is around using scopes now scope is a very powerful action in power automate one of its features is the ability for you to group actions to better organize your flows so if you look at this flow right now i have grouped actions into a scope action and to create a scope action i can just go to add an action search for scope and here is a scope action and the beauty of the scope action is that you can move actions so like select drag and drop them right here so you can move actions you can even have a scope inside a scope and scopes help to organize your flows specifically for large flows the next step is around using the compose action versus creating a variable in flow in flow when you want to use a variable the first step is you have to initialize your variable so let's say i create a variable i give my variable a name variables are strongly typed when you create a variable you have to pick the type of that variable you have multiple options here to choose from in my case let's say i pick a variable of type string i initialize it to an empty value you cannot initialize variable actions in scopes you have to keep them out of the scope initialize them and then you can use them throughout your flow plus you also have the option of updating those variable values if i look at the variable actions i can append to an array variable i can increment or decrement a variable and i can go ahead and set its value so variables are useful when you want to change its value throughout the course of the flow run on the other side we have an action called compose and compose can store any type of data so you don't have to define what is the type of your data so if i just type reza it understands that it's a string if i just type a number it understands that it's a number so it can define your data types dynamically also compose is a lot faster than variables the compose action is more like a static variable a variable whose value does not change during the course of the flow run so if you need static variables use the compose action if you need variables that are going to change during the course of your flow run then in that case go ahead and use the variable action the next tip is around the expression editor and enabling experimental features now in flow for every action you can include expressions so if i just click inside the compose action here i have the option here to pick dynamic content which are basically the attributes that any preceding action and flow exposes or i can head over and start plugging in expressions and with expressions we can do a lot of basic things in flow like converting values comparing values now the expression editor here has a very limited space to play with so if i go ahead and plug in a long expression here in order for me to look at the entire expression i literally have to just move through this so there's not enough real estate here to play with so what i'll recommend is go ahead and turn on the experimental feature right here so go to settings on the top view all power automate settings and select the experimental feature and turn this on when you turn on the experimental feature bear in mind that your browser window will refresh and once the browser window refreshes now if i go to my compose action and click right here you will note that i don't see that option for dynamic content or expression i can select this for dynamic content and i can select this for plugging in my expressions in this wide expression box there's also a nice link here that will take you to the list of all the functions that are available classified right here on the right hand side so if you're looking for string function based expressions just click on this pick any of the expressions here you want to concatenate strings select this it's going to give you the syntax it's going to give you an example very useful now the next tip is how to generate a url for a flow run now as part of your flow it will list out all the runs of your flow so every time my flow runs it locks that right here i can select my flow run and look at all the actions and how they were performed and what were the input and output values for each of those actions so let's say a few of my flow runs failed or if i would like to directly get to a specific run for a specific record in that case i would have to go through all the list of flow runs and search for my record and if i select a specific flow run you will see that each flow run has a specific url associated with it it has the environment name right here it has the id of the flow and it has the run specific good that it generates now if you would like to generate that within your flow itself so that you can store it in your system of record so that i can just click on that link and it takes me directly to the flow run you can do that through expressions and this is what the expression looks like i'm gonna concatenate my flow url please note i'm in the us region so i am plugging in us.flow.microsoft.com this is how i can grab my environment name this is how i can grab my flow name and this is how i can grab the current flow run good i will plug this expression in the description of this video so you can just straight away go copy this and utilize it now tip number 12 is around something known as trigger conditions here i have a flow that gets triggered when a record is created in a sharepoint list called travel requests now this flow will get called every time a record is created in that list but maybe i would like to only call my flow when a record is created and a specific condition is met i have a column known as estimated airfare and this gives me the cost of the estimated airfare for the travel request now maybe i want to start the approval process only if this estimated airfare is greater than 500 dollars for that i can add a very simple condition expression so i can go to my expression here and i can add an expression that says greater than or equal to the value which is my estimated airfare so if this is greater than or equal to 500 and if i click out that's my expression now if i just go ahead and copy this expression i can go to three ellipses and head over to settings right here we have an option for trigger conditions so if i click on add i can plug in that expression right here and bear in mind when you write expressions right here they have to begin with the at symbol so i've just placed the ad symbol if i click done now i've added a trigger condition in which my flow will only begin or only trigger when the estimated airfare of the record created in this list is greater than 500. now what's the advantage one i'm only triggering my flow as and when needed two with flows there is something known as api limits so if i head over to aka dot ms slash service limits this will take me to the request limits and allocations documentation and bear in mind that there are limits to how many api calls you can make in a 24 hour period so it's important to keep your api calls limited and for that one of the key things that you could apply are trigger conditions so that you only trigger your flows as and when needed the next tip is around using peak code to grab expressions or look at the code behind any of the actions so right here i have my get manager action if i want to look at the code the actual code behind this i can go to three ellipses here and go to peak code and this will now show me the code behind this specific action it's using a get request against this api so if you want to deep dive into what's going on at the back end you can do so using peak code another good use case of p code right here i added my expression now if i want to grab the expression and just go to three ellipses go to peak code and here is my complete expression in the input parameter the next tip is on the apply to each loop now right here in my flow i have my get items action to get all the items from my sharepoint list based on the due date and my next step is i'm looping through all the items of my sharepoint list that is being returned based on my query and i'm adding those items into a table in an excel file in my onedrive now if i was to go ahead and just run this flow manually as the flow runs how long does every action take is also tracked so if you look at my loop scope the get items action took one second and then they apply to each loop there were three items written so this loop ran three times and it took five seconds for this to run however go back to that apply to each loop and go to its settings there is a feature here when i can turn on concurrency control basically i can loop through multiple items at once a maximum of 50. 50 loop actions will execute concurrently and this will speed up the process of my apply to each loop let's go ahead and test this out and as you can see right now the speed has increased i've taken a simple example when i only have three records imagine a scenario wherein you're dealing with hundreds of records you can speed up your process right here by just enabling this concurrency feature for the apply to each loop now inside the apply to each loop if your logic requires your items to be processed in a specific order then enabling concurrency might not be a good idea specifically for cases in which you are updating a variable because the loops are running concurrently there is a very high chance that your variables might return inaccurate results so in those scenarios ensure that you don't turn on the concurrency feature the next tip is around number formatting now inflow when you're dealing with numbers there is an action called format number and for this action all you have to provide is a number value and then pick one of the predefined formats i've added three formats one but i just have a number which i will format next i have a number and i'm defining my own custom format so you can also pick the custom format and define any format of your choice i'm defining a usa phone number format and finally i'm picking the out-of-the-box currency format now if i run this flow and we look at the output of all of these actions here's my number it's formatted right here based on two decimal places because that's the formatting that i defined if i look at my custom format that i defined here is the number that i provided and it formatted it right here and finally for the currency here's the number that was provided and here's the result in us dollars the next tip is around date formatting and converting time zones now you can write expressions for these however there is an action available for us and for that if i just search for date time here's the date time option and these are the list of actions that are made available for us you can add to time convert time zone get the current time future time a lot of pre-built actions are available for us right here now the convert time zone action is extremely powerful here are two cases that i've created using that action for the demo here i'm using the expression utc now which gets me the current date and time next you can define the format and there are multiple date formats here that you can choose from next is the source time zone bear in mind flow always understands dates and times in utc format so i am picking coordinated universal time and my destination time zone is any time zone that i would like to convert this date and time to now if you just want to convert the format of your date in that case you can keep the source and destination the same or if you want to actually convert it to your own time zone in my case i am in the central time us so i'm picking the central time zone right here and if we look at the flow run right here here is the output that the first action provided to me this is the date and time in the format that i defined in utc time and here is the date and time output format that i defined and also converted the time zone so this is right now in central standard time and this is when i am recording this video the next tip is around using the data operations action now if i search for data operations there are some very powerful actions that we can play with now one of them was the compose action there are other useful actions here like create csv table so you can create a csv table from an array of data and you can plug that in an excel file or you can create an html table on the fly you can filter arrays you can join data you can parse json you can select specific columns from an array these are extremely powerful operations that you can leverage so right here i'm getting the items from my sharepoint list known as work progress tracker now let's say i want to email myself an html table of the data that's returned from this action basically all the work tasks that are overdue so for this i can use the create html table action provided an array the array here i'll pick it from the dynamic content output of my cad items action and i can go to show advanced options automatic will pick all the columns if i want to pick specific columns i can even do that you can go to custom and say i want to pick specific columns and you can also give the header names of that table that gets created so i want title and the value for this will come from the title column in my get items action so i'm just leveraging the title and description values from this list and generating a table on the fly next i can just go ahead and send an email and the body of my email i'll go to dynamic content and pick the output of my html table action let's go ahead and test this flow now once the flow run completes here is the email that i received and here is all that tabular data of the tasks that are overdue and here is the three records that are overdue and those are exactly the three records that are provided to me right here i can even format this table the next tip is around something known as parallel branching so you can basically run actions in parallel as well needless to say when you do so ensure that there is no dependency between the actions on those parallel branches that's because each of those parallel branches will run simultaneously and to add a parallel branch you can just go to insert and add a parallel branch so let's say i have my date time scope right here i would like to run my error handling scope as well in parallel to this i can place the scope right here and these two actions now will run in parallel when the flow executes the next step is around error handling now in flow for every action you can just go to three ellipses and you'll get a property called configure run after now by default every action that you add runs if it's preceding action is successful so it always assumes that the previous action is successful but what if it fails or what if that action is skipped or timed out you can select any of those scenarios here so i can say that run the step only if the previous action has failed or run this if the previous has failed or is successful so you can define the configure run after settings for each and every action in your flow now we spoke about scopes earlier additionally you can also do configure run after on scopes and create scenarios like try catch i have a scope called try i have a couple of actions in there and then i have another scope called catch wherein i have other actions and i'm sending an email notification to the user and right here for this scope action i can go to configure run after and define that this action will run only if the previous action has failed so if any of these actions fail this action will come alive now as part of my flow i have purposely created an expression that's going to fail so this action will fail the catch block will come alive i go and grab the error value i'm using all the tips that i gave earlier i'm using all those data operations right here to generate the error code create an html table then i'm formatting this table and i'm also generating a link directly to the flow run using expressions so let's go ahead and run this flow now once this flow runs if i open the error handling block you will see that the try action has failed now because i handled the error please note flow does not handle errors automatically you have to do error handling if an error occurs the flow just stops here i have handled the error i have a catch block when i'm grabbing the details of the error and sending a notification email to the flow creator so if i head over to my mail i get an email that tells me that here's the error in my flow run i even get the error message that i've grabbed and here's a link directly to my flow run if i click this it will directly take me to that instance of my flow run so i can then just go and evaluate what the error was now the next tip is around using the flow checker now when you build flows flowchecker is your friend as i go and save this flow if there is any errors that the flow has to highlight or any warnings in the flow checker as i build my flow i can even click on the flow checker and see if there are any issues so right now the flow is warning me that there is an action on this flow that may result in an infinite trigger loop so that's something that i need to handle as part of my flow the flow here triggers when an item is created or modified in a specific sharepoint list and then i am updating that same item in that sharepoint list so what's going to happen the flow triggers the flow updates the item the update item re-triggers the flow and this runs into an infinite loop and this will consume all my api calls and that's why the flow checker is clearly warning me about it so flowchecker is your friend as you're building your flows ensure that you always keep an eye on it now next tip is around testing your flows so when you want to test your flows there's an option right here called test now in my case because it's a manually triggered flow of course i can manually run it right here or i can even go and pick automatic and pick any previous flow run so if there was a specific scenario that resulted in an error and maybe you've made the fix to the flow you would like to run it again you can do so right here by choosing that failed step or you can pick any of the previous flow runs and rerun your flow the next step is around adding a second owner for your flows so if you look at this flow i only have one owner that's me if i head over to edit adding a second owner to your business critical flows is very important if for some reason reza was to leave the organization or my account would be deactivated then this flow would stop working to transfer the ownership of the flow then would require some administrative work however if there was a second owner defined for the flow that owner could take control of the flow and the flow would keep running so let's say i pick a user sarah the moment i pick a second user to be the owner of my flow flow will give me a warning and that warning is that all the connections that i'm leveraging in this flow would be shared with that user in the context of this flow that means through this flow sarah has the same rights to sharepoint that i do and that's the warning that's being provided right here so this is very important to understand from a security standpoint ideally create a service account and that service account could be your secondary owner for your business critical flows next tip is around exporting and importing flows so if i go to the float details page right here if you want to share your flow with other users don't make them owners you have a couple of options one is you can send a copy of your flow to any user in your organization so right here let's say i pick sarah here are my power automate flow tips now click on send sarah will receive an email which will have this flow as a template the moment she clicks on the email and consents to it this flow will be recreated for sara now the beauty is that all the connections would run under sarah's account so sarah has a copy of this flow bear in mind if i make any changes to the flow it won't be reflected in sarah's flow i would have to send a copy again i can also go ahead and export this flow so i can export this flow as a zip file move it into a different tenon different environment or share it with a different user once again in this scenario all the connections would run under the context of the user who would then import this and the way to import a flow right here under my flows you can just go and click import and this will ask you for that zip file which you can upload right here and import it the next important tip is around the flow run duration of 30 days now bear in mind that a flow run times out after 30 days so from the starting point of my flow which is my trigger to the last action in my flow i have 30 days for this to complete very common use case are approval scenarios here i have an approval task now what if my user does not respond for 30 days well in that case after 30 days the flow itself will time out and that approval task would be void so you would want to handle those scenarios one way of handling them if i go to the settings for the approval action in this case i can even define timeouts for my actions and right here you have to plug in your timeouts in iso 8601 format there's also an example given your p1d so that's one day if i specify p20d for example that's 20 days for this action and what happens if this times out well let's say i want to send an email so i can use the send an email action then define when i would like to send this email so i would like to send this email if the previous action has timed out the last tip is around the flow run history please note that your flow run histories are maintained only for a period of 28 days due to gdpr requirements now for my flow here i can see the entire history but only a 28 day run history if i go to all runs i can see all those runs and i do have an option here to download a csv file so i can keep a record of all my flow runs now this is a manual step that you have to take you can even automate this using power automate desktop and lastly a bonus tip to close out this video when you create cloud flows be it automated instant or scheduled those flows will be listed out under cloud flows as long as you are the owner of the flow if you add a secondary owner to the flow or if someone else adds you as an owner to the flow those flows will be available under shared with me if you enjoyed this video then do like comment and subscribe to my youtube channel and thank you so much for watching
Info
Channel: Reza Dorrani
Views: 71,091
Rating: 4.9512892 out of 5
Keywords: power automate tips and tricks, microsoft flow tips and tricks, power automate tips, power automate, power automate flow, power automate flow types, power automate flow tutorial, power automate tutorial, power automate tutorial for beginners, power automate flow error handling, power automate flow checker, power automate flow limits, power automate connectors, flow compose vs variable, microsoft power automate, tips and tricks, reza dorrani, microsoft power automate tips
Id: 8O68-cc-QNo
Channel Id: undefined
Length: 35min 15sec (2115 seconds)
Published: Thu Mar 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.