Use Input & Output Variables in Power Automate Desktop Like a Pro!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey hi everyone today's video is all about power automate we're going to talk Cloud flows we're going to talk desktop flows and we're going to see how we can pass data between the two we're going to use input variables and output variables and let's see at the end how many runs it takes to win the lottery let's do it [Music] one of the first questions that you may have when you know that you're gonna need Cloud flows and desktop flows is where do I start do I start with the cloud flow do I start with the desktop flow the good news is that it doesn't matter if we start in power automate in the cloud like we're gonna do today when we're gonna add the desktop flow action then we're going to be able to create a desktop flow and that will bring us to power to my desktop and if we decide to start with the desktop flow then when we start creating our Cloud flow we are going to be able to reference the desktop flow that we've created separately so let's start in power automat in the cloud for the purpose of this demo the trigger that we are going to use is going to be a button and as you can see we have the possibility to add an input click on add an input and we're going to add a text input we are going to call that player name and instead of please enter your input we're going to put please enter your name and this input is going to be an input variable that we are going to pass to power automate desktop if I click on Next Step this is where we would want to add our desktop flow so I'm going to click on desktop flow and desktop flows are premium connectors and so at this point I'm gonna be able to select the desktop flow that I've created separately or I'm going to be able to create a new one if I click on the drop down menu I have a list of all the desktop flows that I currently created and just right underneath select an item you can see that we can create a desktop flow if we want to and by clicking this this is going to open power to my desktop and we will be able to create our desktop flow but what I'm going to do is I have power to my desktop that's open on the side and we're going to create it separately so you can see the difference between the two now don't worry too much about the connection issue we're going to fix that when we're gonna come back to Power tomat in the cloud so let's go over to power to my desktop and let's start creating our desktop flow you can see that on the right hand side we have input and output variables if we click on the plus sign we can add an input or an output variable so let's start with the input variable this is the value that we are going to receive into Power automat desktop so remember we've created an input in power automating the cloud which was called player name and we want to grab this value and use it in our desktop flow the variable name in here would be the name that is going to be used in power to make desktop so that's the name that you would see when you are in the context of power automate desktop what I'm going to do is I'm going to give them different names so we can see what they are in power automate desktop and in power automate in the cloud so the variable name I'm going to call this pad player name the data type that I'm going to receive is going to be text but you can have text number Boolean value custom objects a list or a data table there is no default values because we need the user to input their name and then we have the external name so the external name would be the name of the variable the way it's going to show when we are in power automat in the cloud so here I'm going to put my player name we can give it a description and we can Mark a sensitive if we want the value to be hidden click save and now my input variable is called PID player name let's grab an action that is actually going to generate a random number and we want a value between 1 and 50. we do not want to generate multiple numbers for our case and the value that's going to be produced is random number click on Save now let's create an output variable again we are going to click on the plus sign and we're going to choose output the variable name would be the name that we would see in power to make desktop we have the data type and then the external name again the external name is the name that we are going to see when we're going to use this variable into Power automate in the cloud let's call this one VAR out for output and random number the data type that we want to send to power automate in the cloud it's going to be a number because we want to send the random number that power to make desktop is going to generate and actually we are going to grab this variable name we're going to put this in the external name and in here I'm going to change that to PID like the input variable so the variable name for power automate desktop is going to have PID as the prefix and the external name that we should see in power automatic in the cloud will be VAR out random number again we can put a description and Mark as sensitive if we want to and then click save and if you notice there it's actually not asking us for a value so how can we make sure that the random number that is going to be generated is actually stored in this output variable and for this we're going to need to set the variable and which variable do we want to set to what we want to set our PID random number click on the X so we can see all the variables that we have we select PID random number and what would be the value well the value is going to be the random number and then select and click save so this way when the desktop flow is generating the number we're saying grab this number and store it into the output variable so this way we can reuse this variable outside of the desktop flow now before we go back to Power automate in the cloud we want to use this input variable this player name that we are going to receive so let's just display a message and the message title is going to be Hi and then we are going to use this input variable value click on the X and then we have player name and let's add just a couple more your number is and then for the message to display we're going to say random number and then our random number we can add an icon if we want to so it'd be information just one button it's okay so we can close the display message and then we're going to leave the rest as default click on Save and now our desktop flow is finished we're generating a random number we're grabbing this number and storing it into an output variable and finally we are going to display a message with the value of the input variable let's save this and let's go back to Power automate in the cloud let's fix that connection issue click on the three dots and then choose the connection that you need so in my case it's going to be my laptop connection let's open the drop down and if we don't have the flow we've just created separately let's click on the refresh button and then at the bottom we have the flow we've just created we need to choose a run mode in that case it's going to be attended and then you can see here the input variable that we have in power automate desktop remember this is the external name that I gave to my variable and what we expect here to receive is the input from the user when we actually run this flow and that input is the player name we're going to save that flow and now it's time to use the output variable from Power automate desktop to power automate in the cloud so how do we actually use this let's add a condition and the condition is going to be if the number which is meant to be between 1 and 50 let's say for example it's going to be above 25 then in that case we're gonna win the lottery and if it's below 25 we're not going to win the lottery so how is this output variable containing the random number showing up in power automate in the cloud if we click on choose a value I'm going to make that a bit bigger we have our thou out random number this is the output value coming from power to Mid desktop so we're going to choose this and we're going to say is greater than or equal we're going to put 25 and if it's greater than 25 we're going to send an email I'm going to send it to myself and for the body we're going to say your number is and then again we're going to look for our output variable if we don't see it in here we can do a search and if the number is below 25 I'm just going to grab this section and put it in the no copy to clipboard then let's go into the no action my clipboard and then we're simply going to change the text set phase and then we're done we're going to save the flow and we're going to run it let's do a test so it's connecting to Outlook to send the email desktop flows we're good to go click on continue this is the inputs that we're going to send to power automate desktop run the flow so the flow is running going to power to my desktop now we have our display message we can see that the input variable is the title so it passed properly and we're going to click on OK and the cloud flow is now going to continue run successfully so we have the email and if we look at the email then the number was five and unfortunately we did not win the lottery so let's try to see if we can win the lottery I'm going to run it again and the same number is 48 and we've now received the email saying that yes we won the lottery this time so this is how input and output variables work input variables this is data coming into power to my desktop and output variables contain values that you want to send from Power automate desktop to power automate in the cloud
Info
Channel: Veronique Lengelle | MVP
Views: 6,896
Rating: undefined out of 5
Keywords: Power Automate, power automate tutorial, microsoft power automate, power automate desktop, power automate desktop tutorial, power automate rpa, power automate for beginners, automation, robotic process automation, microsoft power automate desktop, RPA, Robotic Process Automation, variables, microsoft power platform
Id: B7VAIXOhCZ4
Channel Id: undefined
Length: 12min 21sec (741 seconds)
Published: Thu May 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.