Power Automate Tutorial - Intro to Trigger Conditions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Great stuff! Not only is it saving flow runs but it makes the โ€œwhen an item is created or modifiedโ€ trigger much more manageable.

๐Ÿ‘๏ธŽ︎ 2 ๐Ÿ‘ค๏ธŽ︎ u/Driden1 ๐Ÿ“…๏ธŽ︎ May 26 2020 ๐Ÿ—ซ︎ replies

This is really helpful thank you. I should use Flow more.

I've been asked to create a few training videos for my colleagues on simple tips and tricks in 365. What software do you use? I've heard people recommend Camtasia. Can it do the zoom effect to parts of the screen, and overlay graphics like your guest's Twitter handle at the start?

๐Ÿ‘๏ธŽ︎ 1 ๐Ÿ‘ค๏ธŽ︎ u/Extreme_Dingo ๐Ÿ“…๏ธŽ︎ May 26 2020 ๐Ÿ—ซ︎ replies

Oh this seems great! I am new to Power Automate and just realized how confusing it is for some automated flows. Looking at 10+ successful runs and not knowing what completed makes troubleshooting more difficult.

๐Ÿ‘๏ธŽ︎ 1 ๐Ÿ‘ค๏ธŽ︎ u/unchinhairs ๐Ÿ“…๏ธŽ︎ May 27 2020 ๐Ÿ—ซ︎ replies
Captions
[Music] what's up everybody welcome back I'm John Levesque and I am joined today by Razer Durrani how's it going Razer hello Jon I'm doing good how are you I'm doing really well man I I understand that right now you are captive in your in-laws house yes yes I'm held captive right now in but in a good place San Diego okay man so Razer has been stuck he was traveling when all the kovat lockdown happened and so he hasn't been home in the last month he's been stuck at his in-laws house how so so the lockdown is double bad for him plenty ways Ray's a man welcome to the show thanks so much for coming Raisa is an MVP a dual super user a Yugi leader he's basically like the the Robocop of community like he is built them he's the machine and so Manresa it's an honor to have you on the show I really appreciate you coming and joining I appreciate you inviting me on your show it was about time yeah yeah all right I appreciate that you're right it is and so to make it up to you what I'm gonna do is I'm gonna call you out here at some point and say we're just gonna go ahead and make the second one together so it's great okay great why don't you tell us a little bit about you and what you're gonna be teaching us today how's that absolutely so everyone hello my name is Reza Durrani I am a Microsoft business applications MVP Jon kind of gave my intro I'm a super user yes I'm a dual super user I'm heavily involved in the community forums I try to contribute as much as I can and I encourage others to do the same so please go ahead and get plugged into the community forums and if you don't know what they are I'm sure Jon will put the link in the description for this video so so do get plugged in and majority of the stuff what I have learned in powerpack platform over the course of the last two or three years is purely because of the forum's because I went in there as a student of the forum and now I don't want to call that out but maybe I'm a teacher of the forum you are a master that is correct so a lot of learning on the forums and I think I've got some of that learning here today in for this video that we are doing today and this one is going to be on flow conditional triggers so we're gonna look at how do we use conditional triggers in flow to enhance our experience of flows very cool and so I understand that you can go ahead and share your screen and I understand you're gonna kind of start with a little bit of overview with us right give us the intro to what are triggers before we dump in to jump into conditional triggers all right so let's start with slow so I am on the homepage for flow and if I go to home and if I go to my flows this is gonna list out all the flows that I have created right here and then I have my team flows and other types of flows now when you create a flow each flow is associated with a trigger and a trigger is what defines the type of the flow so if I go to new right here you will notice we have these multiple options here one of them is called the automated flow that means the trigger is based on an automated scenario example an item added in a SharePoint list an instant flow is a type of flow which gets triggered instantly on-demand then we also have scheduled flows that means these flows get triggered based on a schedule and we also have business process flows where and you can define step-by-step end-to-end business process solutions so the types of the flows heavily depend upon the type of the trigger so in this case I'm just going to go ahead and create an instant flow and I'm going to pick the first option that is I will go ahead and manually trigger the flow and I will click on create and this takes me to the flow maker experience and the first thing that you see in the flow maker experience is the trigger that's right on top now a flow that you build has to have one trigger and it cannot have more than one trigger now why does it have to have one trigger it's because there needs to be something that calls the flow that begins the flow that starts the flow and that's why the catch fail if catchphrase triggers the flow so the first action in flow is called the trigger and you have to have a trigger for your flow so that's a very brief introduction on what is a trigger in flow the next step that I want to lead into is how do we use this concept of conditionally triggering my flows so let's talk about a scenario here and in this case I am leveraging sharepoint as a data source and in case of sharepoint i have a list here called tickets wherein I'm just maintaining basic ticket information now let's say my requirement is such that every time a ticket is created in this list I want to trigger a approval process or I want to trigger or notification to the admin of the system that makes sense right and I only want to do so when the priority of the ticket is probably high alright so I only want to notify my admin when the priority of this ticket is high and typically when we go down the path of building a flow for this specific scenario and this is the typical scenario we play out we go to flow and we go to pick automated flow because I want to automatically trigger my flow when an item is created in the SharePoint list and here's my trigger right here the good way I describe these automated triggers is it's it's listening you're telling flow go listen to a system for this specific thing to happen and that's what automated means it's listening somewhere for something and as John mentioned it's listening so it's listening to what in our case it's listening to SharePoint so all I need to do in this case is plug in the details of my SharePoint list that I want to listen to in my case it's a site and SharePoint called help center and once I pick the site it will list out all lists and I'm going to click on my tickets list so right now this flow is listening to my tickets list in my SharePoint repository and every time an item will be added in this list this flow will get triggered so I mentioned that my use cases I want to get notified of the ticket priority is high and I don't want a notification otherwise so the typical scenario is we go ahead and we add a condition and flow right and in the condition we have this dynamic content that we can leverage properties from prior actions and flow so in this case I'm going to go ahead and pick the ticket priority value and then I'm going to say if this value is equal to high in that case go ahead and send me an email notification very simple very straightforward right here to see all three parts of the flow right you get to see a trigger you get to see some conditional logic and then we get to see based on an outcome something happens and what's that thing we send an email right and so it's this is this is the breakdown of every basic flow in the world right here and so I think this is perfect for the introduction all right so here's a typical flow that I create and every time I will create an item in my SharePoint list because the flow is listening it will come alive and because there's a condition that says only get triggered well no condition yet we have a condition action on the flow that says if the ticket priority is high then go ahead and send Reza an email that a high-priority ticket was created in the system and of course I can go ahead and beautify my email based on my use case in this case I'm just keeping it relatively simple yeah so I've saved the flow and the flow is ready now if I go back to my ticket list and let's say I'm just going to go ahead and create quickly create a sample item so I'm going to call this sample item 1 and in this case I pick the ticket priority as high and I'm going to go ahead and save this so I get one ticket that I created with high priority I'm also going to go ahead and create another one I'm going to call this sample item 2 and in this case I'm going to pick medium priority and click on saves so I just created two items in my SharePoint list and because my flow is always and always listening to an item that's created in the SharePoint list it should trigger both times yeah and so this is good I think this is a very common use case and and you know I think approvals and things like this and conditions these are very standard right you have to have these kinds of decisions in in your workflow all the time and I like actually what you did with the list here how you kind of customize the the status and stuff I think adding these kinds of little touches to the SharePoint list is pretty nice it just shows off a nice visual representation for everyone of what's happening there absolutely alright so back into flow as you can see my flow has run twice that's because I created those two items and both the times if I look into my flow history if I look at my first run this flow got triggered when I created the first item the priority value of this ticket was high so of course it's going to go through the condition and because the condition conditions succeeded it will send me an email whereas in the second case the priority of the ticket was medium so the condition in that case does not succeed so as you can see it did not go through the send an email action so I would have received one email and of course if I go to my mailbox I can see that I receive just one email that says your ticket was created ok now this works right and it's a very simple example but this can be scaled as much you can make this as complex as you want now there's a problem here is that although this works we are wasting something known as flow runs hmm now what our flow runs every time my flow gets triggered it's counted as a run so you see I have the runs segment right here and it shows that my flow ran twice yep but because I only want to send an email when an item is created with a high priority ticket value it doesn't make sense for me to trigger the flow and all scenarios and then go and do a conditional check and then send an email oh yeah I see so you're you're essentially just giving away a flow run that you didn't even really need to happen exactly I do not need the floor to run when the ticket priority is anything other than hi I know and this is just one simple example and I will elaborate more on this in a while but the goal here is I need to only run my flow only and only when my condition is met and that's why the topic for today is called conditional flow triggers I want to conditionally trigger the flow that makes way more sense especially in this day and age of you know API calls and all these measurements and I'm sure razors gonna cover all that after but it's a super super important thing and I think actually while you're learning to build flows if you learn these techniques early on and take these on as best practices it's going to really set you up in the long run to be efficient and and and a good steward of your flow runs and and the things that you manage I think so flow runs not only not only add additional history right here so I have to go and figure out which flow ran at what time and what does it protein do because I'm only interested in the ones that are high priority if I run this flow 50 times I would have to go and scan your and figure out which one's a high priority that's problem number one problem number two I'm wasting flow runs I'm wasting API calls problem number three and I will put a link to this in the description of this video as well if you go to aka dot MS service limits power automate has limitations in terms of how many flows or API requests you can call in a 24-hour period and this depends upon your license this is not a licensing session but this is something that you need to be aware of is that based on your license you only have a set number of API calls that you can make per day so if I have 50 flows and those flows are getting called for every scenario in which I should not be calling them I am basically going ahead and wasting API calls which are precious API calls based upon your license right so knowing totally and that's one very important reason to go ahead and start using conditional triggers now let's look at trigger so I'm gonna go back and edit the same flow experience okay and in this case I want to add a condition to my trigger that means I have to take I have to take an action on my trigger so if you go to the three ellipses right here and if you go to settings there's an option you're called trigger conditions and what you can add in trigger conditions is something known as expressions that means now I need to also learn and understand the expression syntax that goes beyond that goes behind flow and flow leverages in fact flow as a subset of a geologic apps so there is a reference guide to all the expressions that are available as part of flow and all these functions are listed out here that you can call so for example string functions if I want to concatenate strings together I can use the concat function so all of these are functions and functions can only be leveraged in something known as expressions and because when I add trigger conditions I can only add expressions that means now I need to also understand the expression syntax of flow now thanks to a new feature that is currently in preview you do not have to learn the expression syntax exactly though when I say expression syntax what I mean is you don't have to know the ins and outs of the syntax of your expression because intelligence will guide you through as long as you know the different functions that are available so let's look at how I can enable the new expression editor in flow so if I go to settings and if I go to view all power automate settings there's an experimental features option here that you can toggle on and once I click on save this will refresh my browser and yeah I mean let me add a quick warning here really quick this is an all or nothing selector if you if you turn this on I just want everyone to understand that you get all experimental features in empower automate we don't have selectors for the end of features yet power apps does that is something we're looking at creating but just know when you turn this on you get all of those experimental features and so just beware don't use this in your production flows that are business critical use this in testing try this out have fun with this but just beware it's still preview ok please carry on and just to add what I'm demoing right now although I'm using the experimental feature I don't have to because you can write expressions in the old expression editor as well it's just that the new expression editor is very simple for someone who is new to flow it's way better when when it reaches when it reaches production it's it's gonna be a fantastic experience right so now I am in the new expression editor I'm going to be using the new expression editor now as you can see my conditioners ticket priority is equal to high and if I hover on the dynamic content I have the expression right behind that it says trigger body question mark ticket priority question mark value know what is all this what is trigger body what's ticket priority what's value trigger body means your trigger in the flow it's referencing the trigger right the next step it says question mark bracket ticket priority ticket priority is basically the name of my column and share point and because my column is of type choice choice columns have an additional attribute called value associated with it every column is different and there are expressions that will that that will be leveraged will be different now you don't have to learn this and I'll show you a trick how to get around this so this is what I normally do I add an action in power flows in flows called compose and in compose there's this new option right here called function and this is because I enabled the preview feature if I head over to function this is the new expression box that opens up for you to write your expressions now in this case because I'm checking to see if the ticket priority value is equal to high as I start typing my function now that's why it's very important for you to know the functions now I already know that function called equals so I'm going to leverage this function and notice how intelligence guides me through the entire process it says equals you're comparing two objects give me object one object one is something that I can dynamically search using the search box at the bottom that's my ticket priority value and the moment I pick this notice how it automatically writes that same expression down for me I don't have to go ahead and understand how the column is structured in SharePoint I don't have to worry about that not just SharePoint this is true for any data source and then I am going to compare this with the word high because that's the text that's in my ticket priority column and that is it for my trigger the moment I click out this will create the expression for me I can copy this expression I can go back to my action to my trigger action go back to trigger conditions and paste my expression now one very important thing to note right now the trigger conditions is just like a text field there is no intelligence right here there is no help right here if I make a mistake like right now I know there's a mistake here so if I click on done and if I click on save you notice it throws an error well it says is there's an error in your expression so what's the error how do I fix this error that's totally up to me now in my scenario although my expression is correct the reason why I have this error is because this is a text-based field expressions are recognized with the character called act right in front of them so all you have to remember is just to place that add symbol and then whatever expression you've copied just paste it right in there and you're good to go now super helpful tip that's a good one so I'm gonna go ahead click on done I'm gonna go ahead click on save and that's it right now I have this expression right here which says trigger my flow only when the ticket priority value is high now the next thing is because I'm my flow is triggering based on the condition I really don't need this condition on the flow because the flow should only be called if the ticket is of a high priority value make sense sorry in that case you can just drag this and place this on the screen and I don't need this and I don't even need my composed statement I just added that because I needed it initially to get the expression so I can plug it into the expression dialog as easy as that right same flow same functionality but there are a lot of savings here and I'll show you how all right I have saved the flow I'm gonna go back and notice our flow runs are - this is from the previous two runs yeah now I'm going to go ahead and create two items one called sample item 3 and this one will be the high priority item and I will create another one sample item 4 and this will be a low priority one right so these are my two new items that I just created one high priority one low priority now in the previous example it would trigger the float twice in this example if the demo gods are with me flow should only trigger once let's check it out have you made all your proper offerings today I try - ok ok it's important you know gods can be fickle yeah so while while Duffy the flow is running in the backend and I think the flow just ran because I received one email that says high priority ticket so let's go back to my flow runs let's refresh this we should only have one more run and as you can see it only ran once and it only ran once for the item which was named ticket 3 which was tagged as high priority nice that is because of the trigger condition I love it man that is awesome so so now ok this is this is great to show and share point but to bring it home for users what are some other ways that this could be used what are some other examples where they could yeah you know apply this to save themselves a I caused absolutely so the beauty of trigger conditions is it applies to every trigger any trigger for that matter so it's not limited to just sharepoint or sequel or serious nice the key is for you to explore what the trigger condition provides what the trigger action provides to you now in SharePoint this is a very simple example right maybe I want to only trigger an approval scenario if someone uploads a attachment in my SharePoint list item right now I can get more serious about this right and I can keep adding more logic to this now we will cover one more scenario let's talk about teams so in this scenario I have a Microsoft team which is called the cat team and we discussed some very important things about the power platform over here only to users and v2 users keep discussing about it so now let's say I want to only have a flow that I create and every time someone uploads or someone adds a message in teams with a high priority marking honored so I can define a message in teams and I can say hey it's important okay I want to trigger my flow so that it can send me an email immediately and tell me that someone has an important message that I should be looking at right now in the normal world how would we play this out once again because the trigger is an automated trigger a service is calling it in this case it's teams research for teams and my trigger is when a new channel message is added so I'm going to click on create I'm gonna pick my team I'm gonna pick the channel for which I want to track the messages and that's it and let's say I want to send an email all I'm going to do is go ahead and send an email right now and send an email and I'm going to send an email to myself and I'm gonna say high priority message and then in the email body I will put the message body that the user plugs in to teams this is all standard flow actions but where is the magic well the magic is I want to only trigger this when the message is marked as a or don't write once again my trick normally normally we would put in a condition here right we would wait and then we would say if priority is high then do this thing right so I'm gonna add that same condition but because I need to steal that expression I am once again adding the compose action and this time again I am going to use the equals action and I'm going to check a property called message importance right so there's a property here called message importance and in this case I want to check to see if the message importance is high okay that's all I'm doing I'm checking to see if the message importance is high or not and this gives me the expression that I can steal oh yeah and so yeah real quick if you guys aren't familiar with compose if you're wondering why does he keep putting in this composed card compose is just kind of like a blank workspace you can put whatever you want in there and use it in your flow you can grab timestamps you can make expressions it's kind of like a little whiteboard area for you to create and so if you haven't used it definitely recommend checking it out and and this is one of the great ways it can be used right here is just grabbing sample stuff and moving it to other places that's what I just did I grabbed the expression just copy pasted it right here and once again I put the add symbol right in front of it I'm gonna head done and that's it I put my expression right here so I don't need the compose action right now so I'm going to delete it I'm gonna go ahead and call this team's flow I'm gonna go ahead and save this super creative name yeah mixed mixed both those services together that's right all right now I'm gonna go into teams with a different persona because I want to show that any it works in any scenario so in this case let's say a user named James comes in and says right and this is just a regular message that he has posted in teams and bad practice he has not even tagged me but the point is that he's just added a standard message in teams which is not a high priority message but may he needs urgent help on a project right so urgent help required thin flow expressions he needs reserve to come in and help figure out an expression syntax and slope you can call that out and he can mark the message as important right and he slacks this message as important now both this both the scenarios are pretty similar is just that this message this message is tagged important yeah now the flow that I created right the trigger is when a new channel message is added that means imagine how chatty channel messages are right you get at least 100 messages a day at least at least and maybe a few of them are important you want this flow to run a hundred times or what do you want this flow to run just those two times when somebody marked the message as important I don't know if I would ever want this flow to run for me but so as you can see the scenario is very straightforward right we need to leverage trigger conditions to reduce API calls it's extremely important to understand why we are doing this more more than more than doing it it's very important to understand why right and if I head back to my flow and we are still waiting for the flow to trigger and while the flow is running so you can add this for any other scenario as well I can think of a hundred other scenarios right a very common scenario that I run across is sometimes there are triggers that are not available for example there is no trigger available that says when an item is modified in SharePoint there is no trigger if you go and search for it that trigger is not available created or modified yeah there is one called created or modified but guess what I can write a condition which says if the created date is not equal to the modified date only then trigger my flow right nice then the creative date and the modified date is the same that means the item was just created if they are different that means the item was modified now that's what I can use trigger conditions to create my own scenario which will only trigger the item is truly mortified see that right there that's a beautiful little I almost feel like that's as valuable as the rest of the video right there all the SharePoint people I call mmhmm yeah did our did our flow run here Nordia wait okay cool waiting on this all right I think I'll float just wrap there it is there it is so if you noticed the user put two messages in the channel and the trigger was to trigger the flow when a channel message is added but only for the high priority or the ones that are marked important yeah if you notice it has only triggered when the message was marked as important and we can see that in the message body which is urgent help required in flow expressions that was the message that the user entered and tagged as urgent very cool very very cool so this can be expanded to multiple scenarios multiple use cases the key takeaway here is the the responsibility for building optimized flows is on the flow maker let's not forget that right now everyone is a flow maker me you anyone as a flow maker anyone can go and create a flow who has a valid license but I need to also be aware that I have a limited set of calls that I can make in a 24 hour period and I need to frugally use it I need to be very sure of the calls that I'm making do not call flows in unnecessary scenarios and I mean you know this was a great example for that I was gonna say from the Microsoft side you can be frivolous it's okay that's very good lesson it's true it is the onus is on the flow maker and and this is an amazing lesson I think anywhere you're using conditions you should consider could I use a trigger condition instead instead of inserting that condition action which allows my flow to run no matter what should I just think of that same thing build a simple expression and insert it into the condition and that's gonna go ahead and save me I mean think about it 50% even even if it cut off you know 10% if it saves you 10% of your runs it's worth it to rethink the possibility of building flows this way and I know that for some of you taking the leap into expressions takes us from no code to low code and for some people that's scary but the workflow definition language guy that Raisa linked there's a lot of videos out there I think Fausto did a series like express yourself and John lose constantly doing something Raisa I'm sure you have tons of stuff as well and so you know get entrenched into this expression language because it is a little intimidating at first but if you'll give yourself the time to learn it a space to learn it and and the commitment to learn it the possibilities really do grow as you can see here even just with how Raisa showed you the intellisense and how simple just you know two different fields comparing each other can can save you these kind of runs and so my my call to action on you guys is this is an amazing amazing intro to trigger conditions and and also two expressions I think showing how to enable that builder showing the intellisense explaining how that that expression broke down I think those are some super valuable nuggets out of this and so take this go to the next level go follow Raisa there's gonna be a ton of descriptions in link for him his YouTube is Twitter he's got so much good stuff go get subscribe to his YouTube he teaches like this all the time and so if you're interested in his style and what he has to say definitely go and follow all his stuff okay raisa man thank you so much for joining this this was awesome I really appreciate you being here in teaching this to us thank you so much John it was a pleasure being here and I hope to come back again soon in future that's right we're gonna do another one you sure that's okay awesome all right you guys heard it here first he's on the hook for another video so you'll see him back alright guys that's it from me go ahead and click like click Subscribe smash that little bell so you get notified when the next new video comes out all right much love from me see you in the next one
Info
Channel: Jon Levesque
Views: 14,541
Rating: 4.9858656 out of 5
Keywords: jon levesque, jon levesque microsoft, trigger conditions, flow trigger conditions, power automate trigger conditions, microsoft flow, microsoft flow tutorial, power automate, microsoft power automate, power automate tutorial, jon levesque youtube, power automate microsoft, trigger condition, conditional trigger, triggers and actions, save flow runs, save api calls
Id: V_Bl5kRyHmk
Channel Id: undefined
Length: 33min 43sec (2023 seconds)
Published: Tue May 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.