The Power of ChatGPT in Power Automate Desktop Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you are a Microsoft power automate desktop developer the tool you want to learn this year is chat DPT I'll show you all my best chat DPT tricks in relation to power automate desktop I'll show you how to set everything up and in the end of this video we will build a very Advanced use case my name is Anna Jensen I'm a Microsoft most valuable professional let's learn some power automate desktop and chat DPT start by navigating to chat.openai.com here you will either log in if you already have a chat DBT account or simply just sign up for a new account this is the graphical user interface of chat DPT one thing you might want to do is to upgrade to chat DPT plus yes it cost you twenty dollar per month but you get no downtime faster response speed and early access to new features it's not necessary at all I did it as you can see here let's continue let me show you how powerful power automate desktop is in combination with chat DPT so I minimize this on my desktop I have a folder called project I double click to open it in there I have five files we are going to use all of them in today's video so you might want to download them I place them in my OneDrive and you can download them by clicking the link in the description below here I want to double click the employees dot xlsx Excel book this is a simple data set I have 31 rows where the first row is the headers row column a ID that is just unique numbers column B that is names randomly generated and finally we have column C that is salaries you can see that some of the salaries are missing I want to create an automation that pays these cells if they are empty red and by the way I also generate a data set with chat DPT of course we could solve this without chat GPT but let me show you how crazy fast it is with chat GPT so I close this then we go back to chat DPT now I just need to tell chat DBT about my problem then it will generate the power automate desktop solution for me so I go down here then I create a prompt I simply just start writing create a VB script that and yes I just write in human language shift and then press enter twice that will make this line breaks without sending in the prompt the first thing I want to do is that I want to find the range of the Excel sheet data then shift enter will give us a new line iterates true the data and paint all of column C's cells red if they are blank this is our problem in a nutshell in human words and don't worry about misspelling chat DBT will fine understand you now click enter this will start generating your code here our script is about to be created you can see we open up an Excel application then we open up an Excel book and this is just a sample path so this part of the script we need to replace it with a variable or the direct file path down here we are iterating to each one of the rows and it even comments the code and says that you need to replace this path with your own go up here and copy code now we're ready to create our solution we go to Power automate desktop click new flow I'll call this one chat GPT click enter and this will create our flow so first to run a VB script it's very simple you just find a run VB script drag it in here yes we just need our code in here so go down here Ctrl V backspace this is 24 lines of code that chat DPT generated for us what we want to change is this path so let's go find it I click save minimize this one here minimize this minimize this and my project folder is actually here to get this path I press shift on my keyboard and right click with my mouse I repeat shift on my keyboard right click with my mouse here I want to find a copy as path go back to Power automate desktop we will create a variable for the path as that is best practice so I go up here and I'll find a set variable I'll drag it in up here in the variable I'll say Excel path as this is a meaningful name in the value I'll press Ctrl V that's it I remove the quotation marks in the end and in the start like this here click save now this variable we will use this name in our script so I double click to open it down here I will delete this example path here and I'll go up to this X double-click the Excel path now we use the variable called Excel path and yes it holds the value of our Excel book and I click save let's try to run it and yes this is our entire solution it took two steps we could have finished it in one step if we wanted to hard code in their path in the VB script let's inspect the data and let's see that we actually solved our mission there you go it's that easy to use chat TPT with power automate desktop I mean how fast and how many actions would this have taken you if you would have had to use power automate desktop native actions I don't even think you can do this so yeah create a powerful link do much more things sometimes you need to refine the scripts a bit but yeah creative fast let's continue so I close this one here another thing that's very powerful with chat DBT let's move back scroll down is that we can explain we can have chat DBT to explain us difficult things for example I can say explain a web request click enter Then an explanation of that topic comes in yes it will probably be 10 lines but it is a nice way to learn let's say that this is a bit too advanced I want to understand things quicker what I always do here is that let me start writing I will say explain a web request like I'm 10 years old now it will suddenly write in a language that I can understand and I can understand it easily of course I know what a web request is but that's how I speed learn a lot of things related to RPA development here it gives a library example another thing we will use the graphical user interface of chat DPT here is we will use it to write cover letters that's right let's go on LinkedIn and find a job so I just moved to linkedin.com that will take me to my LinkedIn profile here I click jobs let's go search for an RPA developer job so I just say RPA developer over here I'll say United States this will give me a list of RPA Developer jobs let's just pick the first one this is just an example so what I do here is that I copy all of this job post Ctrl C and I go back here and here I need to give it a prompt so what else is what I'll say here is that I'll say create a cover letter for the below job post shift enter shift enter control V I pasted it in then I can just click enter and yes now it starts creating our cover letter of course we haven't told about our skills and right now it will just generate a cover letter based on this job post but we can modify we can start adding in our own qualifications and let me just finish this and then we will see how it will edit it so to edit a response I go up here and click this little edit icon now I can edit it here create a cover letter for the below job post so in front of this we will say shift enter shift enter and I'll say I'm 43 yes old I live in Copenhagen my skills are I don't know.net SQL and working in a team just a random little things we can add all the things that we want now we scroll down say save and submit and a new cover letter will be generated you can see that we are now having skills in.net SQL working in the team blah blah blah and yes we can customize it further but this is just to give you an idea of how you can use it as a power domain desktop developer getting jobs now for the advanced part we want to use chat DPT directly in a power automate desktop flow that is true in API so I go down here and what I will do is that if you want to save these two you can click the first one click shift in Click the second one right click disable action then you'll have them as if you want to save them but we want to do an API call directly to chat DPT so up in actions you will find an invoke web service this is a API call we will use we will need a URL and this is the end point that is we want to call chat DPT this URL from chat TPT changes all the time so what you want to do is that you want to go to this address up here and then you will grab this so this is the one that works right now again all these links to these things I gathered them here in the project folder this one will be in the links so we will take this URL we will go back here and then we'll control we paste it in the method that is posed that is because we want to send some data to chat DBT then we want to specify how our data is formatted our data will be formatted in Json and we will also get json's back then we need some custom headers this is our authentication and all this is actually in the documentation from the open AI that is the ones that invented chat DBT but here you will just say all story session colon then you say Bearer have space and now we need an API key go back to my browser to find your API key go to platform dot open api.com forward slash account forward slash API keys and again this link is also in our links in this folder so here click create new secret key and we will copy it here by the way let me just show you something if you click usage up here you get 18 dollars in a free account that is you can use a lot of these requests through the API you can in fact use nine hundred thousand words or approximately there so that's a lot and you'll probably never use them now let's use the API key in our flow I go back here here we will just store it directly into this header but you might want to store it in a secure place in the production flow I'll just Ctrl V and yes I will delete this API key once we're done with the video then we need a request body and the best configuration you will find here there's also a part of the five files we will just use this maybe I can tell you a little bit about what this is this is the information that we send to chat DPT the model that is just a model that we use from chat dbg or open AI in fact The Prompt here user variable can you see user input that is with these percent sign that is a power automate desktop variable or it will be once we implement it in our flow Max those here we will have a thousand as I told you we have 900 000 tokens for free and thousand tokens is about 750 words so around 600 000 700 000 words for free that's a lot you can also down here and stop you can Define up to four words if chat DBT faced them it will stop use more tokens so we will just have it now we will have no stop words copy in this body go back here Ctrl V it in and here you can see we have this user input variable because we haven't created them when we click save in a little while we'll get narrow we just need to create this one thing that is very very important go down here to Advanced in in code request body make sure you untick this otherwise it won't work scroll down to the button the variable that we want to look at especially is the web service response here I can click save and yes we got the arrow as expected so now let's take some user input that we can use to send to chat DPT here I will have a display input dialog drag this one in here I could give it a title I will say chat DPT what this action does it takes an input from the user and then it will store it in this variable called user input yes it's called the same thing as here but we could of course just rename this to use input 2 or whatever you wanted and then you just need to change it here in your invoke web service input dialog message here I'll say ask chat DPT about something like this so and the variables produced again that was user input the button pressed that will lock whether the user clicked okay okay and so that might be useful because if the user clicks cancel we don't want to launch this invoke web service for now let's just disable it make it as simple as possible and I'll click save now we're ready now we have integrated chat DBT directly in our flow so here I will say tell tree nice facts about India now I can click ok then it will take like a few seconds and over here in the web service response I'll double click here this is the data that we get back and let me just expand this and show you where we want to look so here you see India is the world's largest democracy with a population of over 1.3 billion blah blah blah not blah blah blah about the facts but let me just show you how to interpret this and use it in power to my desktop so I go up here click Ctrl a control C we now have it in our clipboard I click close then I go to my browser again here I'll go to Json crack that is Jason crack.com forward slash editor this is a simple Json beautifier that is because the data that we get back is in a Json format so what I do here is that I control V paste in my response this is by the way in a Json format over here we have the visualization this Json crack is very nice at this what I want to do is that at the parent level I want to find the choices that is here the choices is an array you can see that by these hard brackets we only have one element in this array that is this element and yes it's still an array it's just an array with one element in here I want to say I want to go and find the text because here we have our facts and let me just show you it's out here so what we will do here is that we'll say go into choices pick the first item that is 0 because it's zero indexed and then find the text let's do that in power automate desktop this is a Json and power automate desktop needs a custom object to work with that is very easy to do so what I'll do here is that I'll find a convert Json to custom object I will drag it here so what do we want to convert that is this web service response that what's generated up here I click this x web service response the variables produced that will be a jsons custom object I'll click save now we have it as a custom object we can get the text out so what I will do here is that I'll just find a display message let's just see that it's possible then we will see a very nice use case later on so dragging the display message and here I will just say I wanted Json as custom object I double click this then I want to say I want to get the choices so I have a hard bracket a single quotation marks I'll say choices single quotation marks hard bracket then I wanted the first element that is hard brackets zero and then I want to move into the text let me just show you this again so what I wanted to do I want to say I want to go into the choices get me the first element and go into text that is all we're seeing here let us click save let us run it again and see that we can interpret the data so here I will say tell me three nice things about Denmark yes that is my country where are you from so I will click enter then it will take like 10 15 seconds there you go we have now formatted the data so we click OK here let's test chat DBT we want to create a really Advanced example this example is actually suggested by Johan thanks Johan for the nice suggestion Johann says that we can analyze incoming data to example a help desk then we want to extract data out of the incoming data that could be from an email we also want to analyze the tone in it say that the customer is angry or happy and then we want to respond we want to extract the information out to a Json string so we can easily get it into our third-party system let's see how it's done and I really want you to create this because this shows you the power of chat DBT so we go back to our flow again here we will just delete the display input dialog in a little while so first we get incoming emails we will not use outlook here but I'll just use a sample email you could literally just use Outlook if you want here we want to say open up the current email still in the files you can download them from the description below this is our email we want to do analysts on so here it says hi Private Bank of USA why aren't you replying to my emails you charge my account a thousand dollars in fees for no reason what are you thinking I've also ordered a secondary account in euros and I needed created urgently I will find another bank if you have not responded in two days regards yens Anderson an account number so here we definitely want the account number to be extracted the name and then we warn the issues as well we also want to say this is the tone here is not that good so let's do that we go back here we need to do a couple of things first we will need to grab the email and again you could use the Outlook activities for example or the exchange ones and grab the emails from there we will just hard code in an email in a set variable so we drag it in here I will call this current email like this and then I will go ahead and open this one again I will copy it out and move back here Ctrl V this is just my email this could be literally from any Source it doesn't even have to be emailed so now I save it then we need to do something about it because let me just make a break point here let me run it that means that the flow will stop here double click here yes we have these line breaks we cannot use them in our incoming Json string to chat DBT that will not be a validation so we need to do something that's in fact very easy so I click close And I click stop I need to replace these line breaks with a backwards last n because chat DBT interpret a backwards n with a line break so we have the Q and email and then we just need a replace text and I drag it in here so here the text to pass that will be my current email that was the email so I clicked this x and double click here now I need to find the line breaks and in Windows it is backwards R backwards Less in I'll use the regular Expressions because this is regular expression and then I just want to replace it with the backward slash n that is all I have to do here I want to say I want to save it in a replaced variable let us just rename this so I'll say current email replaced like this so now I have my email then I will do the prompt include this email and I'll use it down here in the invoke web service so find another set variable drag it in right after this replace text so what do we want to work on well this will be the user input that we will use in the prompt so I'll just click this x double click the user input what do we want to put in here and we could write it I also saved this one for you that will be the sentiment prompt double click to open it here it says get the personal information about the customer analyze the tone in the email the type of inquiry and highlight the most important topics with a short description place all the outputs in a Json format then we'll have a new line and here comes our email you're more than welcome to copy this from the files again so Ctrl a control C and then we'll just paste it in here so here we say we prompt what we want to ask chat DBT about and down here the Q and email replaced that was our email with no line breaks in and we save it into user input and again we will use that user input here in the invoke web service as we see here now we can delete this display input dialog delete it then click run and we will contact chat DPT with our help this inquiry it will take some seconds and then we will have our response back here you go and let me show you how powerful this is it says custom information here we have the customer information then we have the tone it's frustrated we have a complaint that is the type of inquiry then we have the topics the topics are on and on Android emails fees charge and he wants to open up a secondary account think about how powerful this is and how little effort we made if you want to solve more advanced power automate desktop problems then you should join the I love automation Discord we have more than 6 000 RPA developers helping each other with careers and problems your guiding invitation is right up here
Info
Channel: Anders Jensen
Views: 12,983
Rating: undefined out of 5
Keywords: power automate desktop, anders jensen, chatgpt, power automate desktop chatgpt, power automate desktop and chatgpt, how to use chatgpt in power automate desktop, microsoft power automate desktop, how to use power automate desktop with chatgpt
Id: faCjxIc-vqQ
Channel Id: undefined
Length: 26min 12sec (1572 seconds)
Published: Sun Feb 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.