I FINALLY figured out the SELECTOR BUILDER in Power Automate Desktop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i couldn't figure out what this stuff was until it occurred to me when i saw this eq and i thought what is eq i was like that seems really familiar it's just jquery you know this just makes me wonder has has this entire video been pointless i'm still going to post it all right and you're going to think like dave why did you waste my time with all that stuff i'm sorry wow [Music] hey everybody dave here so i'm going to show you a demo of what i built in this video if you looked at the time probably pretty long i have not edited it yet so i don't know exactly how long but i wouldn't be surprised if it's over an hour long i don't expect anybody to stick around for that long so let me show you what i built and i'm going to run it for you and then afterward if you feel like sticking around and you're trying to learn stuff about power automate desktop then you can watch the rest of the video and hopefully pick up on maybe things i did wrong or things i did right either way so uh the website that i have been working with is called bittrex24 it's a customer relationship management web application i'm using the free version i'm not sponsored by them in any way i'm not suggesting you use the crm app if i were going to put a process into production that automates this web application i would reach out to bittrex and ask them for approval to automate their user interface using robotic process automation but in this case i'm just running a few tests and doing it for demo purposes so i don't think it's that big of a deal so let me walk you through the flow that i've built out then i'll run the demo we've got a main flow a launch flow and get excel data what it will do is launch edge if it's not open already and whenever it launches edge it'll log into the web application if it's open already then it's already logged in after it does that it'll get data from excel i used a website to generate some random data for me 20 rows of data for various columns kind of like what i did for rpachallenge.com except in this case i had to go tell it what kinds of data i need and so i use that random data to enter into this website and then in this for each loop this is where we're doing the bulk of the work navigating to a contact screen and clicking add for each of the text fields that i want to input data into then we're populating those and in some cases we're clicking combo boxes and choosing options beneath that and then at the end it closes the web browser actually i'm going to disable closing the web browser at the end so it stays open so time for a demo let's click run it's going to open edge and then once it gets to the login screen it's going to put in my username and my password and that's from the input parameters that i've given to it once it's in here it's going to get data from excel so you'll p you'll see that pop up really fast in the background and then it clicks into the contacts screen and then it clicks add and so it's adding a new contact so it does salutation last name first name middle name it also does fields like address email phone number and then there's contact type and source so some different things you might would want to maintain as data for contacts in your customer relationship management application while this is running i just want to say a few things about this video you may not want to watch the whole thing and that's completely fine it's going to be kind of a long video i haven't finished editing it yet but it's probably going to be over an hour long if if not close to two hours i built this automation without having really any knowledge of how to work with the selector builder in power automate desktop obviously i used it a little bit for rpachalge.com but in that case i knew the specific syntax that i needed to use for all of the fields and that really didn't present much of a challenge because i knew the the specific syntax that i needed the specific pattern and i didn't really need to understand all the things you can do with selector builder so something that you'll see in this video is that at one point i eventually discover what the syntax is in the selector builder and i'll just tell you up front it's jquery pains me to say that i didn't realize that but you can just write jquery selectors you can't do i think all the things you can do with jquery but specifically jquery selectors you can put into the selector builder and that's what's all based on so once i realized that granted i had to go look up jquery examples and try to come up with a solution for some of the combo boxes and stuff like that but once i had that down it was pretty easy for me to figure out at that point you're probably going to see me mess up a few times and i i try one thing after another after another and rather than cut all that stuff out sometimes i feel like it might be helpful at the very least for you as a developer using power automate desktop to see that you're not the only one who struggles and i don't just come up with this stuff on the spot all the time it takes me time i beat my head against the desk trying to figure out what to do and i google a lot and i i try a hundred different things before i find the one thing that works correctly and then i feel dumb because i didn't realize all that time the right way to do it so if you're there don't worry i'm i'm right there with you i do the same thing and in this video you'll definitely see that and i apologize if it makes the video too long i i you know i'm conflicted about do i want to include everything or do i want to just get to the point and in the rpa challenge video i tried for the most part to just get to the point in this it i'm showing pretty much every single thing i did staring at the screen for long periods of time i'll cut out of the video and you can assume that at certain points when it skips from me talking about something to then talk about something else i probably cut out time where i was staring at the screen like how am i going to solve this and then if i go google stuff for the most part i'm going to keep that out of it but just to assume i'm reading stuff on w3schools or stack overflow or you know the common things that we would look up as developers to try to solve problems all right well it's done it finished adding 20 contacts i think that was pretty fast it's certainly faster than i can type so i'm going to go into here we we disabled the action that closes the browser so i can go in and see that these are all the ones that i added if i click into one of these which by the way this is totally random data this is none of these people are real and the data associated with them is not real either so they're phone numbers and stuff like that so now we're going to cut over to back in the past when i started developing this keep in mind that there's a number of things i learned throughout the video that i know now i just didn't know then things like that you can use jquery and power automate desktop didn't know that at the beginning of this so you'll see that i kind of learned things over time and by the end of the video i'm just like so let's take a look at how much effort it took me to make this automation in order for me not to have to make up a random data set for me to enter into this website after i've built the automation and power automate desktop i went to just a random website apparently macaroo.com is a thing it's actually really fantastic it lets you enter specific fields and then the type of data that you want in that field and then you can generate a data set off of that so i've created a number of fields that will match the fields that are over in bittrex in the contacts area when we add a new contact and you'll see over that i've also set a few rules so some of them for example the salutations drop down box asks you to choose one of the four options you can either not select or you can do one of the four but there's no options outside of that i'm gonna have those four options across all of the different rows of data and then things like date of birth i've put a range of 1940 to the year 2000 and phone number will be in this format and then the contact type and the source will come from these specific list of choices which match up to the drop down box choices over here and i'm gonna now generate some data so let's see how this works download the data wait how many rows is this gonna give me i don't think i inputted that oh here we go so it gave us a thousand rows i don't actually want that many i'm gonna do 20 rows of data i think we're going to download it to excel so let's try that download so i've downloaded that spreadsheet locally and let's look at what the data looks like in excel alright so here's the data set and this looks like pretty much what i was asking for i wanted a bunch of people and random dates of birth and phone numbers and email address i don't actually think i needed gender i should have removed that let's go remove gender i don't know that i need this id i'm going to remove the id just to make it match exactly so these are the fields that i wanted and here's the fields that we're going to use i've removed some of the extra fields that i don't need i'm going to hit download data to get 20 rows of excel data all right let's make sure that we have all the fields of data salutation last name first name second name which i guess is middle name date of birth position phone number email address contact type and source so that should be good to go we'll take all 20 rows of this and we will enter it into our contacts list this time it's going to be a little less structured whereas when i did the rpa challenge.com video i knew where i was going with it there were some decisions that i needed to make along the way but for the most part i already knew that i could do it and i didn't have to make that many decisions it was also fairly easy in this case it's going to be a little bit more difficult and i have also never automated this web page before now you may be asking well why would you automate the user interface of an application like this it looks relatively modern don't they have an api we are pretending like is so very common in rpa is that you want to automate some application the the entering of data into an application but they don't either have an api they won't give you access to the api or um some integration that you'd like to happen is just not possible or is really expensive now i'm not here to sell you rpa i'm just telling you that that's a very common use case and i personally witnessed that a ton of times let's go ahead and start automating this website i'm going to create a new flow in powerautomate desktop and we'll call this bittrex24 so let's go ahead and create some sub flows i know that we're going to want to deal with launching this application so let's do that i'm going to create a sub flow and we'll just call this launch you'll see me fumbling around a lot this isn't blue prism if there's a blue prism i literally know the names of all of the actions in all of the vbos but in this case i i don't even know what half of them are called i'm not even half but i know that it's going to oh it's a launch so launch we're going to do microsoft edge i'm going to choose launch new instance for one of them then duplicate the action and choose attach to running instance that way what i can do is have it use one or the other based upon whether or not microsoft edge is open already on that web page so let's choose launch new instance right initial url needs to exist so i'm actually going to end up naming it url and i'm just going to type this here for now and then i'll probably go add an input variable and give it a default value advanced i want it to clear the cache i think that will cause it to not be logged in potentially whenever it loads i think that'll be good now it's giving me an error because url doesn't exist so let me create an input variable so let's call this url and this is going to be of type text i'm going to use the default value so in this case we're just simulating if it's being passed in and so we'll just actually have it hard coded right here create okay so that will exist as soon as we start the flow a couple other things i need is the username and password that we'll end up using so let me create an input variable for that username and the reason i'm typing username in two spots is that one is the name of it inside the flow and the other one is sort of the parameter name whenever it's being called um externally okay so default value is gonna be dave the rpa guy.com oh no no dave the rpa guy at gmail.com that's the username and uh this is a real email address but don't email me there because i won't get the email i won't notice it we want this to be of type text that looks good we want one more input this is going to be sensitive text we'll name this password and password then the default value is going to be my password all right let's create that and the password is masked because it's secure text now what i want to do is i want to set this up so that it launches a new microsoft edge when we need it to but then it doesn't launch a new microsoft edge when it's already open on this web page so let's duplicate this and change the launch mode to be attached to running instance i'm going to change attach to microsoft edge tab to be by url for tab url i want to use the variable url and then it's going to still go in the same browser variable for the instance save okay now in this case it would do both things right it's going to launch a new microsoft edge and then it would effectively attach to the same thing and we don't want that we want it to first try to attach if it fails to attach then it launches microsoft edge if it doesn't fail then we want it to skip over this and not do it all right so what we want is exit loop no no we want exit subflow i need to create a label first and then i'll show you label okay so a label is not like a control on a web page this label is like it's like labeling a section um or a point in the code that we can go to later this feels very vb like because i think vb has a go to statement but whatever it's here so we're going to use what's available in the tool and we're going to create a label and name this launch new can't put any spaces save this and um now we can configure this action for when it has an error to go to this label and then it will try to launch a new microsoft edge let's open up this action and let's see on error we want it to continue the flow and go to label choose the label launch new save ah okay so if this fails then it should go to here then it'll go here launch new microsoft edge and then it'll exit the flow because we're at the end if it succeeds here meaning that the the stage doesn't um have a problem it finished it thinks it finished properly then it will go to the next action which is exit the subflow which effectively now we're out of the subfloor when we'll be back up the main page so let's go to the main uh is this a flow i guess may the main flow and drag a reference to subflow run subflow choose the subflow launch save let's see we've got this open already right if i run this it should not open edge again it should leave the same one open and we'll know that it did what it was supposed to if it's still on this page because it would navigate to like the login page i think if it were to close edge and reopen it so let's try did it finish i think it finished okay so i think it attached to the one that's open already um let's try to let's close this and run it now and make sure that it launches edge there we go so you see it went down here cool okay so it did log in though that's not quite this isn't quite what i wanted it to do uh i didn't want it to stay logged in maybe what we'll do is come back and add a login later on once um once i've i've ended up logging out at some point then we'll build some of the ui elements and actions to log into the application but right now it looks like it's it's keeping the cookies or whatever so that it um it stays logged in that's fine we are logged in now let's go back to main uh the first thing i can see is that we obviously need to get to the contacts page i'm just gonna use a click let's see we want to click a ui element oh a link click on a link or any element of a web page let's try that one ui element okay right we don't have any ui elements yet so let me just go ahead and add this one for contacts let's do the whole thing i held ctrl and left click for it to show up here okay and then let's save this now i'm going to go over to the ui elements and you'll see that it's created a group for me now under this webpage you know so this is something that we're going to have to work through together because it's it's confusing me what this actually is i'm gonna say something that might make me look really ignorant is this an x path it looks like it to me and if i if i select these nodes it looks like an x path except with greater than symbols between each of the nodes instead of having like um backslashes like i would expect and that's what i'm used to in blue prism having the the backslashes between the nodes if that's what it is i i then i also don't understand this okay so there's a space right here between this node and this node and there's there's there's nothing there what does that mean um and i think it's let's see uh div yeah so it's this div and this table node there's nothing between it does that mean that it's like a wild card it's kind of like having two backslashes or something i don't know what they want me to go for here so i'm gonna go with what just kind of makes most sense to me i see that div says crm control panel menu menu crm contact in this div and then there is a link element inside of it that's the one we want to click so i'm going to uncheck everything above that and i want to know if if this will work by itself so let's update this and we just want to click that link so um let me open this back up i have no idea if this is going to work here we go oh okay it worked i mean i knew it was going to happen all along so maybe i do understand this then because it this this is how i would expect an xpath expression to function uh let's go back and look at it again i want to rename it though let's go with a menu link contacts once we're on contacts we can click the add button which is over to the right let's search for button let's see if that's a thing press button in window this is under ui automation though so that's not web automation press button on web page what's the difference between press button and click link let's just use the link thing again because that worked for us last time okay the ui element right we gotta we gotta add a new ui element choose this um done and then save let's go look at that ui element now wait why did it create a second group maybe it's because of the url when the url changes it creates a separate group and so maybe that actually makes sense let's edit the selectors of this it's got the same ones selected the bottom oh but i don't actually want it to stay like that i don't think ui button primary ui button icon add crm button toolbar ad i mean maybe that's fine i guess we'll just leave it for now but i kind of feel like that's not going to be reliable oh title hey so i think what we can do is change this page title toolbar contact list i don't know which one's more okay id is probably more reliable there titles reliable here so technically i bet that it would work even if i deselected this div but i don't see any harm in leaving it so to be consistent i bet that's gonna work okay we have to test it though should always test especially after you do something that you're like kind of confident will fail okay let's click add oh wait no we want it to navigate let's uh let's go back to deals and it should navigate to it should click contacts and then click add here we go contacts add i'm a professional don't worry i know what i'm doing we're on the new contact page and now i need to get data out of excel probably could have done that before now but uh i didn't so let's add that now let's add a subflow for excel let's do get excel data we've done this before excel oh launch excel okay we want to launch and open the following document it's c colon backslash test backslash crm data dot xlsx instance visible ah sure open as read only yeah i don't know i guess so it's going to go into excel instance we want to close excel let's do not save the documents what's wrong with this document path cannot be empty oh when i clicked one of these i don't know which one it was but i clicked one of these and it it removed the data from here that's right that's kind of a bug in this i need to report that okay c colon backslash test backslash crm underscore data.xlsx save uh we need to get data how did we do this i tell you what i've i've been playing with so many rpa tools lately that i forget how to do this in each one read from excel worksheet is this the one where i need to determine where the the last row is first let's do read from excel worksheet okay range of cells yeah i need to get the end row you know what can i save this cool i want to get is there get last i it's probably like right in front of me and i just don't see it oh i feel i've filtered this so maybe if i go down to the to excel open up a lot of this and then it will be here oh oh oh here it is it's get first free row i was reading that as like get first three rows i was like i don't want that okay um let's do get first free row on column let's pretend like that didn't happen first free row on column read from excel worksheet so here the last row is going to use that variable first free row on column start column is a start row is either one or zero okay in column is um oh i don't know the end column is can i do that automatically too oh wait what is this get first free column slash row of the active worksheet what is this have i have i done this before what first free column for why does first free row exist then oh because you can choose the column ah man i could have used that before okay okay okay okay all right okay okay okay get first free column first free row then in this one i can use first free column and this one i can use first free row advanced first line of range contains column names that should be true save the data will go into excel data which is right here and that's our data so remember there's no inputs or outputs to subflows unfortunately so the data is just going to get pulled out and put into uh into this this data table and i'll be able to access that from anywhere in the flow including the main page and other sub flows all right let's let's uh did not mean to do that i clicked run did not mean to okay um but it worked and we uh do we have the data ooh it did not get any data why did it not get any data oh look first free column it says zero why would it return zero uh wait let's put a break point some break points in here run from here okay and then let's step over this it should launch excel we can clearly see that there's data here and then if i step over this hey what it worked what is going on first free column first free row i don't understand what what's the problem close excel and the data's here i don't i don't understand we definitely just ran that and it didn't work let's go back to the main page and let's run it from the very beginning and just see if like somehow that that negatively impacts things right it's uh uh there's i can i click over here okay cool so let's do this then click add oh oh i'm dumb yeah i'm dumb okay so here's what what i did i don't have the subflow being called so let's let's add a subflow reference to do we want this to be up here we probably want to get the excel data first get excel data well it might maybe after launching the web page so let's do that because if the web page if the website's not working then having the data is not going to help okay now let's actually close this and run it from the beginning it launches hopefully it waits for everything to load that's not looking promising it did not it did not navigate to here oh wait no we got to get the data first from excel uh undo these and hit play again got the data it clicked oh man isn't that exciting when it doesn't it's supposed to okay um so let's make sure we got the data that we want um okay i think that i did something wrong 19 oh it's a zero index based in here why did it get a 20th row probably because yeah okay so when we did get excel data inside of get for your first free row column that's actually going to give us the first open like empty cells and so we don't want to include those so we want to subtract one oh right so let me just make sure if i went to look at this there should be an empty column too yep okay so we actually want to subtract one from the column the first free column that we get and subtract 1 from the first free row that we get and now we can we can run this thing again i'll leave it i'll leave it open i'm going to click over to companies i think it'll still work let's see i don't know contacts opens up this it's oh it's already gotten the excel data so we're good uh let's make sure this worked and there should be 20 right it's going to say 19 here because it's zero index base so that's actually 20 rows and then we have salutation all the way over to source so that looks pretty good then we need to spy some of these fields so we can enter data into them boy this is actually going to be a little easier than i thought it was going to be i think let's let's do do so i don't really like the web recorder that much maybe in a different video i can talk about that maybe they'll update it but i found that it only gives you the absolute xpath and that's not good so maybe i'll come back to that for now we're going to manually do this but just to point out it is possible to do a web recorder and and a lot of the elements will actually work afterward but um web recorder is not really my thing i i it's just it it's not there yet uh we need some ai built into that or something because it's it's too dumb for it to work properly so let's go to ui elements i'm going to click add ui element and then over in this screen let's hold there i'm going to hold ctrl and left click on each of these it'll pop up here let me move this over a little bit more okay so there's the element that i just clicked on let's do last name i don't know why that says contact number that's kind of weird first name there it is uh let's uh i want to go look at these really quick and see how how it's putting these in it looks like it's um oh there's an iframe okay let's just go back over and finish these add ui element we did one two three of them so let's do second name is this creating a separate group no it's not okay it combined those okay cool add ui element again let's do date of birth position wha okay there we go so sometimes it looks like it you can i think what it did here is it used ui automation instead of web automation uh and i think what i read somewhere maybe somebody commented on the video you can like hold control and like use your your scroll on your mouse oh look at that wait is that right yeah look at that okay so so i'm holding ctrl and i'm scrolling on my mouse wheel and it lets you choose different things i don't know how you use that to your advantage exactly but it kind of kind of help when it's hard to kind of mouse over it so there you see it says button i don't know if that's i think that's a ui thing that's interesting okay that's very weird but we got uh date of birth position i'm very distracted now um position i think is what we got already and then phone number i'm just gonna keep making sure that it goes under the web page group email did it add that phone number okay and then we're gonna skip down to address go down to contact type okay also source okay so it's actually calling it a control element and then the last thing is the save button and i think that's going to be it so let's click done now let's create that all that stuff for us i'm going to hit f2 each time to um to rename these and i'm going to be looking at the screenshot which that's actually pretty cool um so maybe i didn't really need to name them because it's got the screenshot but salutation uh last name first name second name date of birth position phone number email address contact type source and then uh button save the rest of these i'm just going to leave them as like the names of what they are rather than putting text or input or whatever because i'm just going to assume their input unless otherwise stated like for this button and then i don't think i need this this group it accidentally used uia mode there's probably a way to force it to use that on purpose i just don't know what it is yet microsoft's documentation of this stuff is like a little lacking right now it'll probably get better over time what's there is good but there's just not enough of it and what is this all right this is the add button so let me name this button add all right this is looking pretty good now i think we can just configure populate i think it's called populate populate populate text field on web page for form filling uh wait do we want to put this in a sub flow i'm going to put this here first and then maybe we'll move it into a subflow later okay browser ui element right is this wait is this after we clicked add this is after we clicked add and then we start want to start entering the data so let's go with an order so this is uh input text okay we need to we need to get data from excel right uh we need to loop through our data so let's do loop let's go look at the loop group i can't remember for each okay what do we want to iterate over it's going to be excel data and then what we want is um we'll call this a contact we can name it sort of the output of each loop to be whatever we want and and when you loop over a data table that's going to be a row like an excel row i think it's called um it's a data row so we'll call that a contact put this inside of here and we want to populate it i can't remember how to reference this but it's something like i think we probably want these around the end and then um yeah i can't i'm gonna have to look this up i can't remember but it's something like contact and then the name of the field was the name of the field again okay let's open this up okay salutation i feel like that's not right uh we need to i need to i need to look this up all right so we are going to go to the power automate desktop documentation uh let's turn on dark mode okay um also can we talk about that the power automate desktop it doesn't have a dark mode whoa all right that should have been the first item on the agenda at make a dark mode before it ever can even work properly make a dark mode so that i don't go blind while i'm trying to read this like ah okay anyway so this is the microsoft power automate desktop i'm sorry this is just power automate documentation and then somewhere on here is the word desktop there we go so i'll just click here and that'll bring us to the documentation for power automate desktop i'm going to scroll down and uh can i just search for data table um manage desktop flows desktop flow designer uh variable data types let's see if there's a data table okay data table here we go oh no that's not it um that's how you create a data table hey to use it here we go um so you just type the name of the variable and then oh right so you don't have to do a for for each loop but i'm probably gonna this first one is what the row number yeah so the one is the row number zero is a column number in my case i'd like to type the actual name so let's go back over to here open up populate text field we'll remove the square brackets i put around the data row so contact is the data row and then i think it will work if i put square brackets with single quotes is that right it only had column numbers but i think this will work and we'll put single quotes for now and that looks like it uh it looked like it looks like it worked maybe i should test this and put a breakpoint here and we're going to run this and and have it yeah i'm gonna have a break on this okay it hasn't populated it yet so let's populate uh it looks like it's going to fail fail to write text inform field that might be because it's the salutation so i might should skip that so let's do disable and then so i guess that means it didn't fail to get the data out of excel so that might we might be good there populate i guess i could just copy this i did ctrl c ctrl v just now and let's configure this to use last name and instead we'll use the last name field is that what it was called there we go last name field in contact uh okay let's test this all right i'm gonna run it hmm okay it's failing to work with these so that might mean that we just need to go through each of the ui elements and actually edit them so that it can find it properly i'm going to assume that's what's happening we'll let it run here until it fails so let's go into the ui elements and for each of these i guess i got to do something with them edit selectors edit selector and then uh let's expand this see what we're working with here um maybe we can get lucky and and do this the same way as we did the the other elements i'm gonna uncheck so i'm a little concerned because it's an iframe and sometimes that can be problematic trying to get to things inside of it but you know maybe it'll work so you might have to keep iframe selected or something i don't know uh here's okay so we're looking for this is salutation so we're gonna look for the word salutation in one of these so let's just start at the bottom work our way up and see if any of these extra attributes that are not selected right now have a value referencing salutation it's not looking good not looking good at all that's fine yeah i i feel like this is going to be this can be a little harder let's um let's go out of this and see if one of the other fields is easier um [Music] it doesn't i guess they're all going to be difficult oh here we go no last name boom okay so that's a thing um that means that this one shouldn't be as hard though iframe i don't that id does not look reliable let's try let's just try unchecking this entirely and see if we can find an input that has an id of last name text here we go cross your fingers hmm it's not working looks like it's just uh oh it's paused does that mean it tried to write something so if i step over this fail to write text in form field okay here's we're gonna we're gonna try something different we're just gonna try to we're gonna try to click into that field let's disable well uh we want the with the salutation field and i'm going to disable this one let's move this up okay so this is going to try to click into the same field that this one was trying to to populate text into and if it works then that means that we can find the element properly we're just it's not working to try to populate text into it and that's an important distinction okay oh shoot okay uh click link on webpage failed so it couldn't it wasn't able to click into here so it wasn't able to find it um did i actually edit that though let me let me change this one to use last name and let's do the same thing again oh wait uh let's try okay i just wanted to put a break point right after this so the first time it'll run through it'll click and then it'll pause okay so it's failing to find the items i don't think i don't think it's finding it and it might be the iframe i'm trying to figure out what um what's going on with not being able to identify these fields and i did notice that they're apparently inside of an iframe i what i want to do is try to figure out the solution to that but i want to record what i'm doing as i do that the first thing i should try is adjusting the last name to show that to tell it that it's in an iframe and this iframe maybe i can use a different let's try this and let's let's see if it can click into the last name field i suppose i don't know yeah it should just not fail right if it fails then we obviously have a problem i don't think i need to oh no because i have to attach we may as well run from the beginning okay here we go hey it did it it worked just including the iframe thing and changing it okay cool cool cool cool cool all right i think i figured it out all i did was i'm going into the ui elements to the last name element and i'm going to go edit selectors and edit selector again this is what i was trying to do with input and id is just last name text that seems like it should work but i guess it being in an iframe makes it difficult so first i thought well what if i just checked this box and i thought well you know we did that already we already tried that and that didn't work what i did change though is you know like i mentioned earlier this does not look reliable because i i assume that's a randomly generated id that might literally change with each page load i have no idea so i unchecked this and instead i looked at some of the other attributes none of them look great but this class up here says side panel iframe but what i was hoping anyways is i i want to use this to identify the iframe and just say hey this is an iframe here's how you can find it and use this but we're still calling an iframe over here and then what you can see is it changed the selector to use the class attribute instead of the id attribute click update close okay and let me show you what i'm expecting it to do is i want it to go click add and then um you know what i want to do is click into this field because we're not typing into anything into it yet but it should just click into that field so let's close this and i'm going to run it again and if it clicks into the field then that means we have successfully gotten to the element and then we can move on there we go so it clicked into the last name field and hopefully that means we can use populate text field on web page and it will work now so let's try that i'm going to delete these let's stop the flow and let's delete this and this we can i think let's go and just re-enable this one and it should be using the same since i updated the ui element over here it should automatically update what this is using let's save that and we're gonna run it again i i'm gonna see if it will work to loop through all of the rows from excel and it should enter one name at a time let's see what happens oh i have a break point let's try that again look at that it's looping through each row of the spreadsheet and entering a different name each time oh that's exciting i love that it colors the field yellow too completely unnecessary but that's cool and this is 20 rows of data so it just finished okay cool next i should configure all of the other ui elements to use that iframe so i'm going to go into each of these and change them to use the class instead of the id wow there's a lot selected there what is going on all right this is the salutation one that we may have a different problem with um let's come back to this i will i will um we'll try to solve this one later let's do all the rest that should be kind of similar change to class uncheck id and you'll see it says iframe and then the class input id name text wait a minute name text oh name i guess is la first name yeah then uh second name edit selector let's change to use class and that looks good date of birth edit the selectors wait is this one different too this one's different too oh that's not good okay well we know we want to choose this we don't know what we want to do with the rest of this down here though oh no this one's good we can just uncheck all these i think i guess we'll find out okay input text that looks reliable to me i don't think we need i mean i guess it doesn't hurt to leave that it's probably always going to be ui control element and uh name is birth date that looks good position change from id to use class iframe class input post text position position post has an abbreviation for position seems kind of weird and selector let's change the iframe to use the class instead of id oh we got a bunch of things to uncheck awesome uncheck uncheck uncheck uncheck check and iframe class and then we got now this one does not look the same so we may have to figure this one out too oh here we go wait crm entity widget content input crm entity widget content phone content input phone i i don't know about this i i think it's probably gonna be fine but that makes me nervous for the class to be that long because if any if any of this changes it breaks so i don't like that too much but we're going to leave it for now because it's probably going to work goodness gracious okay so i i think that there's probably ways for this to have been faster but you know i don't know everything class id uncheck all of these is this one gonna work email what is this oh email no value uh i guess i'll just leave it i mean whatever i i don't know if that needs to stay there or not uh we'll leave it whatever we'll see what happens edit selectors let's okay change the iframe to use class instead of id uncheck uncheck uncheck uncheck uncheck uncheck uncheck uncheck oh my goodness gracious text box what is this for this is for address there's nothing here that says address though uh this one does though we can include this and then um that should work so it's an input of type text that's beneath a division div that has a class of crm address search control block which is underneath an iframe that has class of side panel iframe contact type change to the class okay um what is this one this was i already i said this out loud contact type so we're looking for hmm okay this one might be difficult too we might have to go look at the html of this one okay we'll probably have to come back to that one let's go to source this one's probably gonna have the same issue that one did yep this is gonna have the same issue okay so we'll come back to this one and let's make sure that the save button will work gotta change the iframe and seems like this should be easy yeah i mean type submit control enter uh oh wait what okay this is the iframe right yeah so let's um let's uncheck these and it's going to be a button that has a type of submit i don't know if there's going to be any others like that but i bet there's no other ones that have a title of control enter i'm going to leave all three of these selected because i want it to fail if any of them are not correct error on the side of caution okay now let's save this uh and let's go ahead and fill out the form with as many as these as we think will work which pretty much is all of them except for salutation source button i'm sorry salutation contact type source and like one of these others like date of birth or something also didn't look like it would work properly so i'm gonna duplicate this populate text field and it that one does last name so let's make this one to first name and change this to be first name let's duplicate that change this one to be uh second name duplicate this one will be date of birth um which i may end up disabling because i think that's the one one that didn't work properly date of birth is that what it was how it's spelled here date of birth yep and then position phone number email address contact type source those are all easy and then position position save phone number phone number save email email address address contact type contact type and then source source all right let's toss in a submit uh we want to do a click let's just do click on link on web page i'll go ahead and and and build this in but i think i might disable it oh wait wait for page to load yeah that might that might work but that does mean that we need actually that this click click link on web page add this needs to be here for every single one of them so it should be inside the for each loop i mean all right uh i don't know i can't remember which of these work so let's just take a gander at them again uh yep that's one of them so we've got this one disabled last name should work and first name second name date of birth was oh date of birth is one that should work well which one was it position phone number no phone numbers should technically work that looked really weird but uh email yeah email might work that's also kind of weird we'll have to see address uh i'm not 100 confident about address but we'll we'll try it contact type and source well i thought there were yeah there's three so salutation contact type and source we're going to disable disable this disable this and then we'll see if it can um we'll go ahead and disable the save button as well and then it should just do it should just fill out the fields over and over which means we're only going to add once i'll end up putting this back in so we should add and then loop through all the data filling out the fields and and never actually navigating away uh oh the changes that we save do you want to close the editor hmm so i need to handle that little pop-up okay see how this does surely something's gonna fail all right so it's got the form open last name first name second name date of birth position phone number email address let's make sure is it doing everyone that it should wow okay it's working pretty well so i'm going to let this keep running but i may cut past a lot of this running if they if it all kind of does the same thing all right so i'll probably skip to the end of that rather than playing all 20 rows of that but every single one of them worked that's great now we just need to deal with some of those fields that seem kind of problematic so salutation being the the first one so let's try to deal with that uh in the ui elements let's go to salutation first i just want to take a look at what's here okay so uh you know this being ui control element seems fine we just need something right above this that would indicate this is salutation and i i think i think i've already looked through this but yeah it doesn't look like it's going to be here all right so what we've got to do i think is we're going to have to look at the we're gonna have to look at the html of this page let's try f12 all right and hit uh select an element to inspect it and then let's click on salutation this may be difficult one thing we can go with is that it is the first it is the first drop down on the page and it says control like w 100 or whatever let's go back and see if it showed that yeah so this w 100 could uniquely identify that control so i'm gonna uncheck these and um we're leaving the iframe selected with class we are so we're going to deselect this too okay we're going to keep um basically the iframe level then the parent element that contains the ui control element and we're keeping the actual element itself too let's update that and then let's go ahead and test this one we'll re-enable so you can see that this is using uh so populating the text field salutation which we just edited it's going to take the salutation field from the excel spreadsheet and populate it in there let's close this and we'll click away manually we probably need to handle that later but you know demo and whatnot okay i'm going to click run um i probably don't want this to run all the way through so i'm gonna hit i'll just a break point here and if it can manage to select the first one properly then that's gonna be good enough hey it worked okay um then we maybe we can use that same concept on the other elements let's go look at those in our ui elements let's go to contact type edit selector and then we'll try to do the same thing it looks like the parent element has like a now let me point out this it could change it works right now oh no it says w100 as well what oh man um is it exactly the same thing this is our contact type and then we want to see what the salutation is those are exactly the same you know what let's find this let's find this this element uh f12 hit this let's click here and let's see how close that is here's the label so what we could do is um we could find we would need to find effectively we need to find the the this where'd the label go we need to find this label and then navigate upward one or two elements looks like two elements we have to go up two nodes and then down into an input that has this class where the div has this class that's like w100 wow all right i'm gonna try to figure that out i'm going to try something i think this will work so i want to record that attempt here's what i think this works right we already tested trying to fill in the salutation combo box and that worked but now we need to also do that for contact type and source and those are both uh those both those are both combo boxes so it seems like we're having problems with the combo boxes specifically uh okay you know okay so here's what i'm thinking i could include ordinal which i guess and blue prism would be called match index and here i i'm assuming anyways that's this is the same thing ordinal would be like if there's like a series of the of elements that match this selector then um then go to the you know nth one so the first second third whatever it's set to negative one which i guess it means like don't use this i'm not really sure i'm gonna choose one which i think if it's zero based then zero would go to the first one one would go to the second one and in this case i want to go to the second combo box on the page so i'm gonna do this and then check this box you'll see it puts an eq does that stand for like that probably stands for something eq anyway uh but i think that means like the nth um you know the first or i guess the second one that shows up and let's let's try see let's just see if that works okay we want to do contact type so let's enable contact type we just fixed it okay now that's interesting it just let me click away from there even though we had entered the value into the salutation field that makes me concerned that we didn't actually do that so let me click add and manually select misses then try to click um that means it wasn't actually working we're probably gonna have to have it click this and then click the value that it fit below hmm that's unfortunate yep yep that's unfortunate okay well that's okay we'll leave that for a second and then let's just continue with what with what we're testing i want to know if we can get it to put the contact type into the field let's just put like a break point here it should it'll get to here break and then i'll hit run again it'll it'll it'll do the rest of these fields and then it'll get to here and run it and then it'll go back up and pause oh right i gotta hit this okay so see it put misses but i don't think the form actually accepted that okay now did it oh wait okay the first one is clients which this is already set to so i have no idea it by default it's set to clients so i need to go to the second row where it should change it to suppliers a change to suppliers um but i think if i hit save now it's it's not going to be there see contact type is clients and uh if i go into edit this yeah it says salutation is not selected so it did not accept that um let's let's delete gwendolyn what's-her-face how do we delete how do we delete there's a button that says delete okay uh let's go back over here we're gonna have to change that so what do we got to do differently well we may just have it we may just have it click this and then and then click one of the elements that's probably the easiest way for us to handle it stop this do we want to click a ui element a link we could just do the click link because you know that's been treating us well so far we're gonna have it click the salutation link then wait for page to load i guess so then after that happens we need another element so let's add a ui element let's click here oh right it's got a match i don't know how to do that i don't know how to do dynamic elements let's just buy this we'll rename it um i could spy all four like all the elements separately and then have like a like a choice so if it's mr then select mister if it's misses select misses but i'd rather have it select the text or have it select the option based upon what exactly the text is and just pass that value in dynamically that's got to be a thing but i don't think i've ever done that before this is the salutation value i don't know let's move this up here and then um [Music] we want it to click again but this time it's going to be salutation value hmm so there must be a way there must be a way to make that dynamic edit silhouette oh no that's not the one i want this one why is all this stuff selected i didn't think i included all that stuff oh because i spied that again right let's change this to class and let's um let's what was it that i discovered oh wait this is menu pop-up text oh here we go this is probably where you change to like a uh like you put a variable here or something hmm menu pop-up no icon none of these none of these have what i want uh i don't know i guess i'll just keep all these selected for now and then um so i have to i'm actually going to have to make a custom one after i look at the web page so we got to look at the web page here and uh do f12 we're gonna have to click one of these here we go so i i i think that what we can do is uh go into edit so let's change to custom and then um if i go back over to this this is an element type of span and the inner text is mister so i think that we can just maybe you can use oh look can you do variables here look at that you can do variables here okay i think that i just need to change this to say text i don't know that this is going to work i have a feeling this isn't going to work and then i want to put the uh a variable which i haven't set yet wait no it uh this is the this is the value that we want to select so it should actually be contact and this is a contact type right yeah this is contact type like that there's there's no way that's going to work right uh where were no no this is ah it's salutation not not contact type we're on salutation salutation so it should yeah it should get whatever values from salutation it should find that and choose it salutation sick let me fix that all right let's go into salutation value that ui element and change this to say salutation instead of salutation i don't know if this is too small for you to see but this is just the same thing we used to get the data out of each of the fields in in the other populate text field actions click link on web page failed all right why did it fail the question is uh did i do an incorrect did i do an incorrect uh selector let's test something let's just go like let's just put some crazy stuff in here and see if it allows that if it does then it means it means that we really can't trust it to say that it just didn't work to click on it because it might be like it might be a selector that will just literally never work yeah it's just gonna tell us the same error okay so i i've clearly got something wrong it's not possible to do that then uh or or the the value i'm putting here is not uh is not possible you can't put like so how do you get the inner text and how do you point to it in this i could just try with like like text let's try text i'm just i'm just trying random things at this point colon see what is this colon eq thing what syntax is that from i got to look this up okay so here's the thing ah man i feel really silly um i i could not figure out what the syntax was for for this stuff in in uh empower automate like i couldn't figure out what this stuff was until it occurred to me when i saw this eq and i thought what is eq i was like that seems really familiar like now granted i've only done this a little bit uh so it's not that big of a deal that i didn't know immediately but uh it's just i'm pretty sure it's just straight up jquery syntax i mean it doesn't include like the dollar sign and uh like the parentheses but i'm i'm guessing that all of this stuff uh you know the like this or this like this would all work in power automate it's just it's just jquery all this time i could have been looking that up as a reference um and there's probably i'm sure there's you know tons and tons of tutorials about jquery and i've only used it a little bit so it just didn't occur to me um but when i saw this that's when it really sealed it for me i'm assuming uh right because there's that greater than symbol that that indicates like um so here's div and then it's saying all uh paragraph elements that are a direct child of the div element so this does mean like this element goes directly to this element and then there's my question from earlier when it's when there's nothing between them it's saying um any paragraph element or i guess all paragraph elements that are descendants or beneath this node that's the division or the div well um i i i that this really opens up a world of possibilities maybe excessively so in power automate so um oh wow you know this just makes me wonder has has this entire video been pointless uh i'm still gonna post it all right you're gonna see this and you're gonna think like dave why did you waste my time with all that stuff i'm sorry wow okay hmm i should have known this i feel really silly all right well you know we we just do we give up now i don't even know so i don't know what all capability there is in jquery what i'm probably going to do is look for salutation and then if jquery lets you navigate upward a couple of elements and then look for a control like a combo box control that's beneath the element that it goes up to and then it'll find this and it'll work let's try that i'm going to add a ui element and we're going to spy uh we're going to spy this and this okay then we're gonna sort of combine the two didn't i spy two things there we go uh okay let's let's go let's call this label salutation i can't spell this word right south oh salutation and then let's rename this oh this is salutation value salutation value 2. and then what i think i want to do is adjust um do i want to copy something out of here we definitely need the iframe thing still maybe and then um [Music] what i'm looking for what i'm looking for is the label that indicates that's salutation okay so i just need to click through here hopefully one of these um says that it does not um okay that's that's fine i didn't want this to be easy where's the label okay here's okay so it's a label so i can actually just type this manually [Music] so let's go down to this we're going to go custom and i do want to keep these maybe maybe i can just use that last one div class ui control element potentially i'm gonna delete everything i gotta fix that edit we need to change this to use the class instead of the id and then i can change to custom delete everything up to here um and then i think what i want is label open close square brackets and then um all right i i don't know how in jquery to reference like the inner text of something so i need to know that selector inner text inner text we need to get the value of the inner text contains oh um contains selector so let's look for contains here it is so we can just use colon contains and then the value that we're looking for i want it to be equal to that though maybe we'll go with contains for now the label should contain i guess that works but we don't want it to be hello it needs to say salutation and then uh and then i want a tilde it should find a div that's after this in the html then find a div that's beneath that oh man uh i need to rename this this is actually the the combo box itself we'll just go combo like that and put that up here and what i just wanted to do is click on cbo combo salutation what maybe i was supposed to do this uh let's maybe it's supposed to be label contains like that all right let's try this hey i think it clicked it because it highlighted it okay we might be we might be onto something now i i don't know how much time i've been spending on this um it's uh it's midnight now and i'm i'm tired uh but i wanted to point out i figured some stuff out i did reading on um jquery and and uh i don't even know what i did differently i mean i know what i did but like i don't know what series of steps i took so instead of showing you each step i'm just going to show you what i have at the end oh goodness gracious okay so here here's the here's the selector i have and this works and we'll probably end up using this for the first click at least so let me point out what we're going for uh when we're in this screen and we want to um we want to specifically be choosing the salutation drop down there's no way to uniquely identify this combo box by itself so we kind of need to anchor it to something so what i've what i did is i made i made a jquery selector that looks for a div element that contains both a label of salutation and then it goes and selects a child element from inside of that div that matches the this control type this class ui ctl element so here's the iframe like we always have and inside that it looks for a div that has a label that contains the word salutation and it's hard to see maybe but this is still attached to that right so like this whole thing uh this class equals this long um stuff that is part of identifying this div so it both has to have a label it says salutation and it has to match this this class then once it's found that it then looks in below that so all the elements beneath that find one where it's a div and it has a class of ui ctl element man boy you know these these loco no code tools are just easy to use and that works i'll show you um this may not seem like it's a big deal that this works but it is a big deal because i can use what i've just learned to choose one of the one of the elements inside this combo box okay so there you go it clicked this and so now these these um choices appear so now i should be able to you know it just occurred to me i probably didn't i probably don't have to click here i might be able to use let's uh let's disable this for a second oh let me stop this let's disable this and let's use a populate text field uh is this what i want click on web page okay i might end up needing that but for now i'm going to disable that too uh put a break point here okay so what i'm what it should do i need to change it to use this the combo salutation is the one i've been working on it should put the value into that field and something that just occurred to me i should try is um is change this emulate typing so that's interesting actually i thought i was going to turn this on and and that that would um that would then work i kind of want to test this i i need to test it all the way through but i want it to fill out one whole thing uh okay let's test this this should stop okay so i'm going to click save and now i just want to go and see if it says misses or not nope not selected okay so that didn't work i just wanted to test that and make sure okay so that that's not going to be a thing uh we won't be able to populate the text field that's fine so we'll go back to what i was originally planning to do is first we'll we'll click into the combo box so that it shows and then and so now i need the click link on web page i need to to click specifically salutation value let's go to the ui elements i'm going to rename this to combobox and salutation value and i'm going to do something similar to what i did in this one with a somewhat complex selector let me just go steal that from over here this it's not going to be labeled though i need i think i need to go look at it over here and we need f12 i think i want to select maybe i'll just select any of them and it's okay so it's going to be a span is the type of the element that contains the value that we're looking for and it will be underneath so let's go to custom so i know that at the very bottom i want so i think i want span has label and i believe i can just delete most of this stuff see class menu pop-up i don't think i need this so it should look for so iframe and then inside that find a div that has a class of menu pop-up inside that find a span where it has oh it's not a label oh it is a span that contains this so i think i don't need has uh so span contains salute f span contains we'll just first do mr to make sure that that works and i think i can just delete this one so it's just that left and this was cbo salutation value let's enable this i've already selected it i'm okay i feel like this will work but i have been wrong before and multiple times tonight oh that worked okay now if i just let this continue oh it's going to reselect it but that's okay okay um now let me save what is this possible clones i don't care uh oh look at that it's saved it's saved oh that's exciting okay let's delete this stuff otherwise it's gonna keep telling me that there's a clone i'll tell you what this is gonna definitely be done in a couple of sessions i i i can't stay awake any longer i just i want this to work and then i'm gonna go to sleep and then we'll do this tomorrow night okay so i think here i just want to i think this is where i can go copy the the value i have in here yeah salutation value like that is this the salutation yeah okay let's see if that works now i'm probably just gonna let it run and it'll uh will it keep will that work properly i think it'll work hope didn't mean to click save again uh all right here we go mrs is that what the first line is i don't know i can't see it oh wait can i click away i think i can click away and it'll be it'll work in the background mr i should be able to do the same thing with the contact type and the source literally the same thing so i'll have it look for you know verify where the label is find the el the element that contains that label and the combo box select the combo box by clicking on it and then click the thing below um boy i'm tired but i kind of want to finish this what are we on rollin nova park all right let's go ahead and stop it there i i think that we have success with this let's um just because i can't stop myself let me go ahead and try to fix the um the other elements these one uh not this one let's delete this delete that we want the contact type this will be we need to go look at that so like it says contact type it's a lowercase t i don't know if that matters change to custom and then uh we do not need all of this stuff oh wait i could have just copied it from earlier but let me see if i can remember it it was uh i feel like it was um div it's like div has label contains in this case it's what was it contact type well this is getting confusing and then inside that a div that has a class of ui control element now let me just let me go over and verify how i did this before uh what this is not the right one we want this one all right so yeah i don't know that i really needed this i think i probably over complicated it by adding this part it definitely helps verify for sure but i don't think i needed it so i think we just need the div has label contains and i think i have that over there and then this so it should just work like it is then um let's go ahead and fix source custom we want this to be div has um label contains and it's going to be a source with a capital s and then find a ui ctl element underneath that so i think i can enable this oh no these are these don't work anymore these don't work at all i guess and then uh let's see populate text field cbo oh this isn't this isn't we don't want this yeah because that this chooses for us we don't want that um populate text field on web page this is address okay so we need to copy the clicks that we did up here for salutation and paste them down here change this to instead use contact type i just realized i didn't i didn't create a secondary element i'll have to create a secondary element for each of the other ones so i don't think we need label anymore or salutation uh i will need this again okay the first one is going to click source so to click contact type and then click the value for contact type which i got to fix that click source and then click the value for source so let's rename this to cbo source for combo box rename this to combo box and then we need to steal this i wonder if it'll just work if i just put that the value uh oh i think i need another element though yeah i need another element so let's just go ahead and spy it i guess we'll select this one for now and then also i guess i should point out i am i'm holding control wait can i yeah i'm holding ctrl and scrolling my mouse wheel so that it'll select different elements i'm going to go with the div here and yeah that's two menu boxes our menu pop-up items this is for source uh menu pop-up so i think the exact same thing will work let me go copy that from over here for value oh wait this says menu pop-up i think it still works change to custom yeah menu pop-up so i'm just going to paste this and change salutation to be contact contact type so it gets the right column that should work and then this one will do the same thing except this is for source we'll change this so this clicks on combo box contact type i need to rename these this one is cbo contact type value this one is cbo source value just move these and now i need to click the contact type combo box click the contact type value in the combo box click the source combo box then click the value that's in the source combo box whoo man and let's go ahead and try enabling clicking the save button i don't know if i need to change this one or not let's let's go to the save button look at the selectors here oh right um i guess that should probably still work wait why does it say title empty oh title equals control enter i see okay yeah let's try that okay here we go mrs bosworth first name benny okay so here's where it should click oh wait a minute what do we what's happening it didn't click the value and contact type but it didn't i mean it didn't even open the value let's just run it again and maybe what we can change is when it does the address i did notice some weird stuff going on here unfocus text box after filling it let's try that see if that helps anything close it might it might just be that i got something wrong i don't feel like i did yeah it's just not opening i feel like it's not clicking the contact type so take a look at what's going on with contact type combo box so it should find a label that contains contact type inside the iframe find a label it says contact type and then find a div that contains the label contact type you know the i did there there is there is something i did different there um let's go copy from here this class which i i assume is going to be the same for all of them but i'm not 100 sure let's paste this in because maybe that did matter maybe past me is smarter than current me uh okay so we gave that extra identifier for the selector now we'll try this again from the beginning because i don't know how to run from the middle i mean i'm sure i guess for testing i could i could set it up that way yeah because i don't think it was even clicking the box the combo box to begin with okay clicked it definitely clicked at that time okay was it supposed to put clients it was right it was supposed to put clients yeah so i mean it put the right value in there um it's having a hard time clicking the save button that's okay because we've learned all about jquery now and let's see if we can't make that better i'm gonna go look at the html over here at the say oh here the save button wow uh i want it to show me the i guess that's the button uh title control enter i mean it seems like it should work with just that so yeah it seems like it should work just like this technically let's just test that see how it does oh okay so we don't actually know what happens after you after you create a client okay okay okay now what we need to do uh first is delete this then let's bring these links in to the loop i probably don't need it to navigate back to contacts again i guess i could just have it do that i'll have it do that for now no no no that's silly why make it go slower for no reason all right so now i should click add again and we'll see how that does um maybe i need to have it maybe i do need to have it and navigate back to contacts first all right so first as i might end up having it click this close button but first i think i may have it uh delete i may have it uh just click navigate back to contacts again and then that might that might do it let's try run this again okay navigates contacts i feel like this one's gonna work navigate to contacts looks like it's working all right well now now we could just go get a cup of coffee sip on that coffee you know maybe check the news or the weather while while this is doing our work for us we definitely have a few more things we gotta add in this before it would be worth running for ourselves in production all right that's it i i have to think about this and see if i want to add anything to this automation one thing i need to add is logging into the web application so in order to get to that i also need it to bring me to the login screen whenever we try to open the app and right now because of cookies it's remembering my login and so i don't actually have to log in because that it's unpredictable when it's going to bring up the login screen for now i think i'd just like it to log in every time i open edge and obviously it doesn't log in if edge is already open so in the case where it opens a new instance of edge i'm going to go to the advanced section of this and change this setting clear cookies to true and that way it should i think that's what i was going for with clearing the cache but i think i needed to clear the cookies so let's try that i'm going to save and i'm going to rerun this so that it goes to the login page let's put a break point right here and then we'll step over it when we get to that all right let's step and it launched let's see if it goes cool so it cleared the cookies and it went to the login page and that's perfect now what i need to do is add a few more ui elements one for entering an email and then probably one for next one for the password and then whatever button it is to log in so let's go to our workflow and over to the ui elements and i'm going to add a ui element let's use this one and this one then i'll go ahead and put in my email manually oops again don't email me there because i don't check that email and then we'll log in and on here i'm going to buy this element too and i guess we'll just leave them remember me because it doesn't really matter and then this next button which that might be the same button as before so maybe i could reuse that okay and then let's click done all right so now we've got our new elements let me let's see let's rename this can i rename this uh login screen and we'll rename this contacts i guess i should call this contacts screen all right here we want username username i don't know actually it's probably going to be the same let's see if the definitions of these are the the exact same thing in edit selector if i scroll all the way to the bottom it just says ui button submit um i think we might have to go look at the page so let's uh let's click and i click back into your password [Music] okay here we go i'm going to hit f12 and click this then click the button the button data action is submit that actually seems reasonable because i i doubt there's any others that have any other buttons that have a data action of submit and then if i need to i could include one of these divs above something like b24 network auth form field block okay so what we'll do is include just that node for kind of like an anchor point and then inside it'll be a button that has it looks like data components not a data data action submit so we could just use type submit and i think that might work but i'm going to change this to custom and instead of using class and type we'll just do data component equals submit i'm sorry data action submit and let's see if that works update it okay so that was for the next button so let's rename this button next and i think that probably will work for this one as well when we're doing the next button after inputting the password yeah it's the same thing so i'm going to delete this element and then we'll just reuse the other one change this to password uh input id is password that looks like that'll probably work and let's just move this up username password button next and then what we want to do let's let's uh minimize this okay we're going to launch and then we're getting data from excel so probably in the launch we could log in yeah so if it launches uh edge then we'll log in if it's attaching to edge then it won't log in because we'll assume that it's already logged in so let's add a populate text field and then choose wait what populate text oh this is not the right one we want the web automation one use the browser instance scroll down let's use username and then the username that we'll put in is going to be from a variable that i created which is probably called username yep and then let's copy and paste this now let's change it to password and here instead of just inputting text variable or expression we're going to use direct sensitive text input wait oh you you what why would you not be able to use uh a a variable right here that makes no sense why would you ever type the sensitive text directly in here okay microsoft that makes no sense uh so we're gonna switch back to input as text variable or expression and we're gonna use password here and we'll hope that the password stays masked save okay and then after we do that we want to oh we gotta actually click next in between each of these so let's use click link on web page and use the next button copy this and paste it drag the duplicate down here so it should fill in the username click next fill in the password and then click next and after that we should be logged in basically so let's make sure that this is waiting for the page to load actually does it click it before or after i guess it probably it probably waits for the page to load before clicking and then what happens after launch it gets excel data so it'll probably have time to load and then the first time we do something inside this loop does this wait for the page to load yes it does okay so we should be good there all right let's close this and see if it will log in let's put a break point oh we've got a break point let's keep it going all right put in the username click next put in the password click next wow that worked pretty easily what is this oh it's a new pop-up uh that's unfortunate i wonder if that will interfere with anything it it it would have okay well maybe that's something we deal with but whatever the other thing we need to do is click close or log out i guess we could log out or we could just close we could just close edge and call it good so let's try that let's go to the web automation area and see if there's a close web browser what where did it go i went like this and clicked save what oh wow it put it inside the 4-h okay that's weird microsoft please that's just silly okay now let's um let's simulate as if it goes through all of this and we're just gonna disable this pull for each loop what no statement found to match the in statement oh my goodness okay so you can't just disable that whole section all right fine fine that's fine what we'll do is put a break point here move the close web browser up and then we'll just run the sort of first part of the flow to make sure it works properly so it should launch log in get data from excel and then close the browser and then we'll run it one more time after that to make sure that this kind of thing can be run in succession and let's hit stop run it again all right i think we're good to go all right so let's go ahead and take the break point out minimize this for each loop and drag this web browser down to below the for each loop microsoft there all right all right let's try this i'm going to undo and i'm going to drag the for each loop up and it expands it what okay goodness gracious okay so launch and log in get the data from excel fill in all the data adding all the contacts and then close the web browser at the end well we made it we made it through automating this web page for the first time i did not i i barely prepared for this i apologize if anything was confusing i tried to build everything on screen without taking too many steps in the wrong direction but i tried a bunch of different things and i don't know that it necessarily helps you it doesn't help anybody to learn anything i i don't think but it might at least make you feel better to see that this happens to other people too like you think you understand an rpa tool but then you realize you don't and it was a huge thing for me to realize that that syntax in the selector builder to realize that this stuff is jquery i mean it looked like xpath expressions and in a way actually it's it's very similar but it has some differences syntactically which explained why it had those greater than symbols now i want to go back and look at the microsoft documentation to see if does it actually specifically say this is jquery maybe they just expect all developers will know this but clearly not everyone will because i didn't if that's awkward because i've used jquery before it was it was a couple of years ago but still i i do know what it is and i've used it a little so i should have known thanks for joining me i hope that you have learned something if nothing else i hope you were entertained or you feel better about yourself because you're not the only one feeling like the microsoft documentation is kind of limited probably feeling like uh you don't really know how to use power automate desktop to its fullest extent and i would encourage you to google jquery w3schools.com and then you can come into jquery selectors and this is where you can look at all the different options but note there's probably a bunch of other jquery stuff that doesn't work in power automate desktop you're specifically looking for jquery selectors and so in these examples everything that's inside these parentheses is what you're going to want well actually inside the quotation marks really this dollar sign parenthesis quotation and then at the end the quotation and parenthesis is going to be not what you're going to use when you put into the selector builder i think that microsoft is effectively using this to wrap whatever you type in there i encourage you to look into that and and learn more about it i certainly am going to this is pretty fantastic because at this point there's there's nothing you can't identify on any web page using jquery just got to learn how thanks so much for joining me and i will see you in the next video
Info
Channel: Dave The RPA Guy
Views: 4,683
Rating: 4.9266057 out of 5
Keywords: Power Automate, Power Automate Desktop, PAD, RPA, Robotic Process Automation, Robotic Processing Automation, IPA, ML, Machine Learning, AI, Artificial Intelligence, Intelligent Automation, Automation, Technology, Innovation, Application Development, Dave The RPA Guy, Tutorial, JQuery, Selector Builder
Id: cgK_BH1gBzc
Channel Id: undefined
Length: 125min 55sec (7555 seconds)
Published: Sat Jun 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.