Chapter - 6 Object Studio

1 hour 38 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€95.86
List Price:  €134.21
You save:  €38.35
£79.54
List Price:  £111.35
You save:  £31.81
CA$143.56
List Price:  CA$200.99
You save:  CA$57.43
A$159.95
List Price:  A$223.94
You save:  A$63.98
S$135.54
List Price:  S$189.77
You save:  S$54.22
HK$777.41
List Price:  HK$1,088.41
You save:  HK$310.99
CHF 89.37
List Price:  CHF 125.13
You save:  CHF 35.75
NOK kr1,131.89
List Price:  NOK kr1,584.70
You save:  NOK kr452.80
DKK kr715.08
List Price:  DKK kr1,001.15
You save:  DKK kr286.06
NZ$176.78
List Price:  NZ$247.50
You save:  NZ$70.72
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳11,900.85
List Price:  ৳16,661.67
You save:  ৳4,760.81
₹8,494.03
List Price:  ₹11,891.98
You save:  ₹3,397.95
RM450.75
List Price:  RM631.07
You save:  RM180.32
₦154,505.46
List Price:  ₦216,313.83
You save:  ₦61,808.36
₨27,720.51
List Price:  ₨38,809.83
You save:  ₨11,089.31
฿3,419.79
List Price:  ฿4,787.84
You save:  ฿1,368.05
₺3,506.82
List Price:  ₺4,909.70
You save:  ₺1,402.87
B$608.53
List Price:  B$851.97
You save:  B$243.44
R1,831.63
List Price:  R2,564.36
You save:  R732.72
Лв187.37
List Price:  Лв262.33
You save:  Лв74.95
₩144,627.53
List Price:  ₩202,484.33
You save:  ₩57,856.80
₪363.83
List Price:  ₪509.39
You save:  ₪145.55
₱5,882.91
List Price:  ₱8,236.31
You save:  ₱2,353.40
¥15,642.93
List Price:  ¥21,900.73
You save:  ¥6,257.80
MX$2,007.92
List Price:  MX$2,811.18
You save:  MX$803.25
QR363.05
List Price:  QR508.28
You save:  QR145.23
P1,376.48
List Price:  P1,927.13
You save:  P550.64
KSh12,857.29
List Price:  KSh18,000.72
You save:  KSh5,143.43
E£5,087.81
List Price:  E£7,123.14
You save:  E£2,035.32
ብር12,414.52
List Price:  ብር17,380.83
You save:  ብር4,966.30
Kz91,790.82
List Price:  Kz128,510.82
You save:  Kz36,720
CLP$98,780.55
List Price:  CLP$138,296.72
You save:  CLP$39,516.17
CN¥729.56
List Price:  CN¥1,021.42
You save:  CN¥291.85
RD$6,064.47
List Price:  RD$8,490.50
You save:  RD$2,426.03
DA13,486.35
List Price:  DA18,881.43
You save:  DA5,395.08
FJ$231.62
List Price:  FJ$324.28
You save:  FJ$92.66
Q767.35
List Price:  Q1,074.32
You save:  Q306.97
GY$20,835.60
List Price:  GY$29,170.68
You save:  GY$8,335.07
ISK kr13,848.23
List Price:  ISK kr19,388.08
You save:  ISK kr5,539.84
DH1,002.31
List Price:  DH1,403.28
You save:  DH400.96
L1,836.70
List Price:  L2,571.46
You save:  L734.75
ден5,897.23
List Price:  ден8,256.37
You save:  ден2,359.13
MOP$797.27
List Price:  MOP$1,116.21
You save:  MOP$318.94
N$1,833.49
List Price:  N$2,566.96
You save:  N$733.47
C$3,664.75
List Price:  C$5,130.79
You save:  C$1,466.04
रु13,546.73
List Price:  रु18,965.97
You save:  रु5,419.23
S/370.84
List Price:  S/519.19
You save:  S/148.35
K403.85
List Price:  K565.40
You save:  K161.55
SAR375.59
List Price:  SAR525.84
You save:  SAR150.25
ZK2,756.13
List Price:  ZK3,858.69
You save:  ZK1,102.56
L477.10
List Price:  L667.96
You save:  L190.86
Kč2,408.98
List Price:  Kč3,372.68
You save:  Kč963.69
Ft39,690.03
List Price:  Ft55,567.63
You save:  Ft15,877.60
SEK kr1,103.14
List Price:  SEK kr1,544.45
You save:  SEK kr441.30
ARS$101,779.64
List Price:  ARS$142,495.57
You save:  ARS$40,715.92
Bs688.19
List Price:  Bs963.50
You save:  Bs275.30
COP$435,927.07
List Price:  COP$610,315.34
You save:  COP$174,388.27
₡50,246.58
List Price:  ₡70,347.23
You save:  ₡20,100.64
L2,528.04
List Price:  L3,539.36
You save:  L1,011.31
₲776,552.46
List Price:  ₲1,087,204.52
You save:  ₲310,652.05
$U4,441.97
List Price:  $U6,218.94
You save:  $U1,776.96
zł408.81
List Price:  zł572.35
You save:  zł163.54
Already have an account? Log In

Transcript

Chapter Six objects to do. In this chapter, we'll be going through an overview of four objects to do is how it works. We are going to discuss about how the objects within the object studio are processed in which particular sequence or how we operate using the objects. We're going to discuss the accompanying stages and operations that are performed. And we're also going to discuss about the action stage. Overview.

We have briefly discussed about business objects before. Business Objects are the programs that interact with external applications and reside in the area within blue prism called objects to do. Business Objects, unlike process flows don't exist in a hierarchical fashion. All pages within a business object are available at the same level. This means that we have to provide the object name, as well as the page name to access its stages. To access the pages within the object studio, we use action stage in the process flow diagrams.

The overall execution of a process accessing business object and its underlying pages, in this case looks like this. Like we start, we access the page one, we go back to the main process, any other process page or the main process itself. If it is accessing the page, second page of the business object, it goes here, but every time we have to refer it's not going to be like you access page one and automatically all these would be executed now. So anytime you want to use the business object, you have to give the business object name as well as the page name. And once this is done, you can probably finish with final computations or anything that needs to be done next how Objects work. So there are various steps involved in using objects will understand the steps of creating an object, assigning an external application to be used by the RPA bot for interaction, identify particular elements for input output operations, and using a process within the process studio to execute the Business Objects through an example.

Also, it's worth noting that we have quite a few internal business objects that come alongside RPA tool for operations on collections, work, use for resource sharing, encryptions etc, etc. Also, we have business objects available for standard enterprise applications like MS Word, MS Excel, notepad databases, and more. That can be used as is to perform different operations. These are usually available in the blue prism installation directory, under your vo folder, in case not failed they can be downloaded as is from the XML files available online and can be used directly. So just to show you where it is, we access our the installation directory and once you go usually this program files blue prism limited and blue prism automate and under the V Bo you have these XML files, which provides a lot of these functionalities like predefined business objects and the pages and operations for MS Excel for MS Word for SQL Server for early databases for some calendars data for collections which is really very important date and time manipulations as well.

Environment file management we will be using a few of these in subsequent chapters. But if not, you can find them online and download them and to import them into to make them available into your blue prism bot. What you first and foremost have to do is you have to go to file and import them. And once you import them you choose this file and it's pretty easy from there and it will be available for your perusal in for your for any usage for any of the business objects that you have imported. You can directly use them. Okay, creating a business object.

First and foremost, we create the business object by right clicking on here in the object and we choose Create object. Right once we do that, we provide a legible name and a description and the Bo gets created successfully. We also created one last time so this is what we're going to use. I opened the business object you can see That initializing cleanup pages are the ones that come by default. Right initialization page is used to add some operations, we may want to perform before the business object gets loaded, like you know the initialization steps that you may want to use. This means that before any action stage, only first and foremost, from a process flow makes use of any page within the business object initialized page would be executed.

Similarly, cleanup page is executed after the last action referencing to any page of the Bo finishes execution. So it usually incorporates cleanup actions like memory cleansing or the allocation of some resources or etc, etc. Hence, the relevant names are being used in here. Right. It is also worth noting that both these pages are optional, and by default only start and end stages are straightforward connected to each other. So you may, you may not use them totally depends on you.

Next, we're going to talk about accessing the external application. After initialization and the cleanup pages, right, let's create a page called launch. Okay, we can also rename this page by simply clicking here and choosing the Rename option, which we just did. And to access an application and its UI elements, we the blue prism makes use of an inbuilt capability called application modeler. So in launching an application, we'll need to provide blue prism with a few details, like the application type, installation directory, etc. So let's click on the application modeler.

And okay, it's application name, we can provide anything, let's provide it as my CRM application Okay, this could be anything depending on the type of application you're just going to be interacting with. And once we hit the next, we have to provide the option to choose the type of application blue prism needs to interact with. There are several types of applications supported, such as the Windows application, the Java based application, the browser based application and mainframe application. In this particular use case, we'll be using the Windows application, since our application runs via an executable file. Next, and yes, that's what we're going to be doing or if you want it if you want it to be running automatically, like if it is running in the back end and you wanted to run it like that, or you want to just attach your program to a running instance of a of an application, then you can choose this option as well.

And here you provide the location where this time executable file is available. So you browse currently I have it in my, on my desktop itself, my cm dot exe. Right. And on hitting Next, we also are given the option to provide any command line parameters, which are sometimes used to initiate the application along with some specifications. A good example would be to start a Windows application like MS Word and MS Excel, like an instance of the application would be opened. And we can provide in these parameters we can provide like one two or different file names.

So that application instance along with those particular files would be opened in a single, like when we are launching the application, all those things would open up in just a single, you know, stage itself in just a single process itself. Okay, and we don't have any command line parameters in this one and the last one here We actually get the option to provide a working directory location, which our target application will be using. So in our use case, we'll just move on moving this. And we also get to set the interaction based on our own configuration, right, like 32 bit or 64 bit and everything. So we just hit this continue, as this doesn't matter much and the wizard is complete. Alright, so now, before moving on, we must understand the basic structure of a window of any application.

Once we open an application, let's open it like this. I have it open here, right. Once we have an application open we get a window which may contain any number of containers, frames, panes, tabs, labels, radio buttons, Right here, right. And the text fields, checkboxes buttons drop down menus. I mean, there could be way too much. So while performing manually, we direct our actions to the corresponding UI element and generate the desired result.

Like, if I want to put here a name. So I'm currently interacting with this text box. This is the UI element, right? And we direct our actions specifically to the UI elements. To identify an element from an application window, like which should already be running, right, the application shouldn't be running and should be active. So in case Launch button is enabled with application modeler, we need to press it to launch So right now the Launch button is open.

This means this instance is not correctly connected to what we need to have to interact with this. So I'm simply going to close this. I can launch the application directly from here and the application just Got launched. These are the default parameters that are coming from the application itself. Right. And now, this Launch button is not available in here anymore.

Rather, we have the option to identify the elements. So we have the application open, and we have it. Like the identify button, the element one is coming like by default, when we give the initial values to the application modeler. We got the element, right, the first element. So what the first element we want, we want, let's say the first name, right? You're gonna name it accordingly.

And we identify. And here we also get different modes in which we want the identification to work like the windows 32 mode, you can change these by pressing the Alt key, like, right now I have the accessibility mode. Then there's a region mode. To go to specific regions, but windows 32 mode is, is. Okay. So to select a particular UI element, and you can see which one which of the modes is working, but for this, let's say, because we gave the name as first name, so we have to keep pressing the CTRL button and press the left click of the mouse when the element is selected, the one with the right the red border.

So here it is. We did that. And we got all the attributes corresponding to that particular UI element, the first name, right, this all these UI elements aren't get like are visible to us right now. And we can play around with them. We are gonna see you know, what all attributes have been chosen by our like automatically by the application modeler to it. Identify the particular UI element by clicking on this highlight.

So right now it's able to identify the correct UI element you can see, right? And we can change attributes to make the UI element identification process more reliable. Like, you know, we have some parent attributes, we have the visibility, we have the dye. So a lot of other stuff is going to be there. And there's a possibility that you know, upon re execution of a program, so, you know, the element might not be visible are the element might have some different attributes. And you may want to interact with the element still, but you might not be able to because the elements have changed to some extent.

So we should always choose reliable attributes within the elements. Let's, let's take a quick example. Right? So suppose I'm entering Multiple names one after the other, or the subsequent details, right? So right now I have Oscar and all this stuff. Let's check this.

If you see, I'm just giving a quick example here. The window text says Oscar, right? And because it is Oscar available right now, it's able to identify this UI element. Now, suppose my next name that I put in was way above. And I tried to highlight this. It couldn't, the application couldn't highlight the or couldn't find the particular UI element.

So all the tick marked attributes should match precisely so that our bot can identify the UI element and work or perform any operations on it. Like any subsequent operations that you might be giving, it should be able to first identify and perform these operations on that UI element. Right. So you sort of get the idea how these work and you might have to play around with the attributes, you get better through practice. That's the only way to get comfortable with these attributes because it it's really hard to understand each and every attribute. But it's definitely a very simple and easy process to make an educated guess and be able to comprehend to some extent what exactly this attribute is doing.

Right? When x and parent y is gonna be something ready to coordinate right parents window text is name. So because just imagine right we have taken the first name and it is provided in a container called this name. This is acting as a container for this particular UI element. And this acting is, this is like the parent and parent has a name. It has a window text called name, right?

So if you are sure that this is not gonna change, select this That's perfectly fine. And let's take this Oscar out. And let's see February. So we have to right now, it's able to identify two different elements. What can we do to make sure that we are a, we are getting only one particular element highlighted. So one major one that we use is the ordinal.

In order to know, with the help of ordinal, we are able to identify the correct UI element. So now, no matter what name we put in here, we are able to highlight the correct UI element pretty much at all times. Right? We hit Apply. And now we have the first name all like a reliable set of attributes has been selected to be for the bot to be able to interact with first name UI element, for sure. Right.

That's how we provide other elements as well. We simply add the element and that's it. It as I just like one right, and in here we identify, we put this value by pressing Ctrl. And I'm going to use the same thing. We don't want this 1049 Park Avenue. Let's also select the ordinal you might have to play around with others as well ordinal may may not be able to solve the issue.

So we are going to discuss a few more later. But in this case it is so perfect. And same way, all the attributes you'll be playing around with, you can add those elements in the application modeler. And you can highlight them to make sure that you're able to see those addresses or any all those UI elements, you're able to identify them correctly. Now next, we're going to talk about input output business objects, stages. So there are different business objects stages that can be used to operate upon UI elements.

The first thing we're going to talk about is the navigate stage. So this stage is one of the most useful stage, providing various input output operations such as mouse clicks, press buttons, select items, launch or terminate an application, etc, etc. Right? So first, let's say you want to launch the application, right. And this is something which a lot of people get confused with, because you will be launching the application, right? So sometimes people take, we have to give the UI element as an input to this stage, the navigation stage.

And sometimes people give the element as first name or address line or something. But this is at the application level, not at the UI element level. So you got to take the application as the element, right, which is the CRM application, you're going to actually put the actual assets Launch? And yes, you got the application open. Right? You can and this is what the launch page is going to do, right?

So you simply connect this, you close the instance, because currently, you see, it's already launched based on the previous exercise that we did. And either you can detach it or you can simply close it, it will automatically get detached. You can launch it explicitly from the application modeler using this Launch button or here or you can use the Launch button from here as well or using the stages which is of course, the way we are going to do when we will be creating the bot and we will be accessing the business object from the process flow diagrams. Okay, so launch is here. Let's try and run and see how it works. We just launched the application and here it is.

The application called Shinnecock lunged okay. Similarly, For other operations, like pressing a button, or marking or marking a checkbox or terminating the last application, we use the navigation stage. And we select the corresponding UI element and the action that needs to be performed on it. And there we go. Alright, next we're going to talk about a writing stage. So once the UI element is identified in application modeler, and the writing operation needs to be performed on it, we use this stage, which is right here.

Let's create a separate page for it to show the writing operation how it works. And let's imagine that we need to enter the first name and the address because those are the reasons we selected. We could have selected more as well. And what we do is we select the writing operation right here. And just close the application, I just closed the application. So that becomes easier.

We select the element, which is right here, and a value. So the value because it's gonna be a text value, so we can provide it in double quotes because that's how text values are recognized. It's a type unknown right now, right? So if you provided in double quotes, it's it knows that you're going to provide some text value, and we can provide any name let's say, Kevin, right. And to showcase how the address is going to work, I'm going to take another example where you're gonna have a data item. And it's of type text, and let's provide initial value of one one to one best 30 say Street, New York.

Something. That's it. That's it. Okay, hit OK. And in writing operation, we add the parameter or we can add another write stage as well in the program totally up to us, we select the element, which is right here. And we have the data items available to this page in here in this pane. So based on the data data types that we have, this is the text data type and provide that with the value here.

So we hit OK. And we connect these two. And before running it, you can see that this Launch button is supposed to be, you know, the application needs to be launched, in order for us to be able to, you know, perform the computation or the operations in here. So, what we're going to do is we're going to simply launch it, either from here from The application model or from the launch the page, the Bo page that we created. Right? For this, for the sake of how the writing operation works, let's just simply launch it from here, we have the default values. And if you want to see how the application is gonna perform the operations, we simply run it now.

Start right operation and you see both these got added the name and the address line one based on the data that we provided. So in the writing operation as well, we can simply add the element and provide the values and we're all set. Pretty easy right? Okay. And a good practice is that you know, you should keep all operations on the application under separate pages within the business object, right. So, we know that you know, the lodging operation is carried out through this.

We got the Writing operation as a separate page in here, and similarly, any other operations that we may need to perform, create a separate page for it so that we know what different capabilities are provided by the bot. Right. And we can use only those we may have like thousands of capabilities, but we may use in a particular process flow only those capabilities that are required, right. So that that increases the scalability as well, they enhance stability of the overall project, because you may want to add more and more features to your bot, but using them, that's a question that, that, you know, that the business folks decide that you know, this is what the capability we want in this particular operation. This is not the capability that we want in the current operations, so just leave it as is not implemented. Okay, so the next section we're going to talk about is the read stage.

So let's create another page to show Guess how read operation works, it is pretty similar to the right one. What we're going to do is similar to the writing operation, read stage reads data from the UI elements to an application like like a text box or labels, etc. and stores that extracted data into a local data item. Right? In our use case, let's consider that we want to extract address line to write or an city as well or anything. So what we're going to do is we're going to read, write, the application is already installed.

It's already launched, so no issues there. We go there. And we need to have that element. So what we want to do is we go to the application modeler since it's already installed, launched so we can just identify the elements that we need. And no, so my bad I was like, Identify and the address line one would have been overwritten with the new element that I would have identified. Not a good approach, let's add an element.

And it gave us the, the message that helped me understand what exactly I was going to do. So address line two, right? And let's identify it is the address line two. I selected it. I still remember. I'm one department seven, it could have been anything.

So here and we select the ordinal and see if it works, yes. And apply. And similarly, let's take the city as well. Let's take this out with the Arduino Okay, and apply. Okay. So read address and city, right.

And just hit OK for the time being. Let's create two different data items. I'll also show you another capability. Let's put this one as address to write up data type text. and hit OK. What we're going to do is we're going to select the address line two element, which is of unknown type, what data is going to have, what operation is going to perform is gonna get the text from this right and we select the Okay, I put it as address to t. Okay, it's stored in here and shouldn't Right, let's add another element, which is going to have the city. Same get text.

And just to showcase, we can also create the variables directly from here using this, this eraser sort of thing here, just click on this. And it automatically created with a very decent name, it automatically created the data item is called value from city, right based on this element name that we gave. So if you want just to just to create an ad hoc instead of going back and forth again and again and creating the data items, or dragging and dropping it, simply use them from here and you should be all set. So hit OK. You got the value from city the address as well. Links right here, it still launched the application. I'm going to change this to call condo number 32 and City, let's put it as Los Angeles, anything.

Okay? We go here, we run the program, and you see address duty and value from city, both of them got extracted and they are working just fine. Right. So that's how the read operation works. You can select any UI element and try to read data from it. There are other things also that are supported like getting the window attributes and stuff.

So just play around and see, depending on what you're trying to implement. You have to extract the data accordingly, as well as other accompanying stages or operations. Along with the input output operations, there may be activities that accompany usual processes to make sure the program runs effectively. A quick example would be to enter let's say login credentials to a screen only when the corresponding sign in text boxes are available or are visible in front of you. Right. So, to accomplish this, the first stage we're going to talk about is the wait stage.

So there may be cases when we may need to pause an already executing process. This is critical for applications that may respond slowly to our last operation, or may have been causing delay due to unavailable system resources, even when performed manually, right we work only when an application finishes loading, so that we can continue our further activities legibly. In blue prism, Business Objects, we use wait stage to pause for a defined time limit and resume if an underlying condition is met. If no, if not, then separate note, called timeout, directs the flow of process and executes subsequently So in our use case, like for this CRM application, let's make the bot more reliable by checking whether the corresponding fields where some input output operation needs to be performed, exists. And if they exist, then only further operations will be performed. So, if not, then we'll leave it.

So for this example, we have like three different tabs, people, company and other. Right. And we may have different operations for people, we may have different operations for company and we may have different operations for other, right, let's say hypothetically, that the bar that just working on right now, maybe in any of these three different tabs, we may not know. But we want to perform the operations based on which tab it is. So Let's say this is how our wait stages, right? And before going here, let's go to the application modeler and just analyze first and foremost, let's analyze.

So in people, we have name, address, phone and email, and company. We have this address phone, and not an email or anything other. We have totally different things. So what we're going to do is, huh, but we have company name in the company, right? So let's take an example where we opened the application modeler and we add the element. Excuse me.

And let's name this as people identify, and let's see, we're going to select the whole container. Right. And it's got the name that we do want the name label this time, right? So this is all good. Anything bigger This is a container. This seems to be working fine.

We might not need to change anything. Let's add something for the company as well. Right? highlight company name. We don't want the ABC computers or anything, we just want the name to be written. Like the ABC, the NME or the company name, NME.

All these labels should be there. So this looks okay as well. And for the other. Let's add an element and call it other. I didn't define And we put this other information. Okay?

Let's highlight should be good. And apply and hit OK. All right. So now let's say Actually, let's create a new page itself wait stage example we hit OK and I got this, paste it here okay. And in here we go to the wait stage the first one, it is also like like looping stage it also is accompanied by a timeout to stage right and what we do is in here let's say First check if the people tab exists like is that the one that is available, and it's of type flag which we discussed in the data types. And comparison is going to be like is equal to true. That means that check exists means that the people tab or that element, the people name or name element that we provided, does that exist?

Right, let's say if it does, then we will perform some sort of computations, like adding data into performing the reading writing operation, or whatever it is. Right? We'll add another check to see if the company one exists. And we'll add the last one if the other one exists. So once we want to see which one actually exists, we hit OK. And we see three anchor points are automatically generated. Right and based on these computation direction would be selected.

So let's say if this if the first one the people want exists, then we are going to perform these operations. Let's use the page because all our operations that we have performed so far are based on the people tab itself. We didn't go to other depths at that time. So we'll go here in the page in reference, and let's say writing operation is what we want to write. We'll link it and once you connect it to the first anchor point, you see people check exists. That means this will be true if the people check condition exists, which means the people condition this one that this tab is visible to the bot, right?

If not, you may want to perform something else or simply ended totally up To you, I'm going to use another stage called the node stage, which is simply like comments. It doesn't process anything, it's just like for to increase the comprehensibility of the program or whatever we are working on the business object, any stage. These are like the comments that a developer usually puts in. So company check is true. And, again, doesn't matter. I can just click it here.

And you see company check exists is ready. And and the last one is going to be if the generic The other one is true. So I'm gonna add another note. Just to make it okay. And what the last, actually let me make it more Alright. And what it does is if you go to the weight stage again, there's also a timeout period that we provided in here, which is by default, five seconds.

So it's going to wait for these checks any of these checks to exist for five seconds. And if none of those exist, then it will execute the timeout stage. Right? We can put it any number of seconds that we want. And it's gonna wait for that time unless it becomes visible. Usually, like, when you're dealing with a web page, right?

And you want to access your mom, I didn't know you're in, let's say mail server. You provide your login ID and your password. And sometimes it's it like probably the server is down or is performing with a lower sort of performance, then you would want to probably wait 2030 seconds before saying that, you know, the timeout I are unable to log in or any sort of system notification you would want to generate, you probably would want to wait for a decent amount of time. So that's what we set in here. Right? And once that happens, we can do anything we want.

So these are like not the ending stages because these are performing the operations all true. But what I'm gonna do is, actually, let's add end stages in front of all of these. Okay? And this looks like this. I can make it better. Okay.

So if you see if whichever works, will be the bath of the program will depend on the tab that is chosen in here. Right. So let's run this and see how it works. I usually make it a little like restart. screen so that you can see the flow of the program as well as the operations that are being performed on the CRM application. So we hit here, and I shouldn't have, but it's okay.

Wait, the project exists and it went there, perform the right operation here and worked fine. Right. So if you see the right operation actually worked on the address line too. That means somehow, our address line this just like one element is actually being chosen as this address, which means our attributes are not correct. Let's check that out. There's like one in here, if you highlight it, it's saying address line two.

And if we select the address line two, it's unable to match it. So For this line to work, we're gonna see first, let's settle the claim one. Right. Let's see if ancestry text is going to help in any case, no sister Dexter's same select. If you see if you're not able to somehow get to the correct element, there may be something that you need to change. Or you can simply go to identify and select the UI element again.

If you highlight it this time, it's getting both dnn selected. So what we're gonna do is we're gonna take this into textile. Nope. Right now it's selecting more than one it didn't already know or didn't know. Static works fine. Right apply for the address line to by highlight, it's unable to match the window.

So you got to play around with these attributes on operating on them. There might be some changes that I might have done and okay so now if I perform this operation again, the weight stage example. Let's see how it turns out. We probably take this out both of these and hit OK. Right operation where the name was given and address line one was selected and the process worked just fine. It got completed.

If the problem if there is some problem if it didn't execute any stage or it was unable to match the correct element if it couldn't find the element itself or something like that, if there's any sort of error, instead of completed in the title bar, it would show as failed or terminated or some sort of error. Right? So steeple check existed. So this particular direction was chosen. If we choose this one, the company tab, and we see how this works. Then we reset the program.

Run, wait and come back. recheck exists. So this note which is not doing anything, it simply ended program got completed and this was the stage and this was the visibility of the Excel application at this time. So, correspondingly, the weight stage was able to find that company check exists and direct the programming distraction. Okay. Next, we're going to talk about two of the small concepts which are pretty much related to the weight stage itself, which we just used.

First is called timeout. So, if no action condition is provided within the weights stage, right, let's open the weight stage and these actions. Let's remove these. Right. If we simply have no action conditions, then it acts as a pausing stage where the program waits for a defined amount of time, which is provided in here and continues the execution. This process discipline nomina is called setting a timeout.

So sometimes we may want our program not to run too fast let's let's slow it down a little bit. Let's pause for five seconds and then continue the execution because usually that happens when you're dealing with external applications that are not able to cope up with the speed that RP you know tool offers, right usually with the MS Excel VBA O's, right they we might have a lot of VB scripts that that may take some time with all the Enable macros to to get executed. So in that case, you will want it to just wait for some time and then perform the execution. So bot gets to wait for this timeout period that we set and continue the execution accordingly. All right, and the next one is called throttle. So there are times when we may need to control the execution of a program right.

This could be based on the criteria like application response time delay in a availability of data item values, system limitations, network bandwidth, etc etc. So the process of controlling the execution speed of a business object execution by using several timeouts and different areas is called throttling. So that means this one we can make name it as a timeout or something about and put it up for five seconds itself, the ones with the default delete them, and this is gonna act as the timeout stage. So, every time it reaches here, it's gonna wait for five seconds and then continue the execution which could be any other computations that we may put after this timeout stage. This one, the second one, okay. Another additional information is that instead of using the static values, this timeout within this weight stage.

We can also add literally This, we can also add some numeric data as the timeout value, right. And that way, it's going to wait five seconds, 10 seconds, whatever it is based on whatever the value we have for that number. We can add that by simply dragging and dropping it into this text area. As again, we have the expression editor, where we can validate based on the data item or any evaluation that we may want to do five plus 15, or some data values that we may want to add. We can do anything accordingly. Okay, and also, a very recommended practice that people should follow, especially in real time projects is using some variables as global variables in this initialize page.

And, in here, what people usually do is, let's say we have data item, right? And we put it as small timeout. And itself number type that initial value of five, right? So, put it here, make it global by unhiding it from other pages in the process. And let's make a medium timeout 15 seconds, just making values again, and let's say make a high timeout have 30 seconds. Okay.

And all of these are unhidden. That means to other pages that means they are globally available. And when you're using these in any of the pages, we simply use these activities right the timeout after building the stages and Here they're not available yet. Let's save this for now. In here, you can find out and you see, you can use like a small timeout and you can name it Accordingly right. So similarly, you can use medium timeouts, long timeout and any any sort of timeout that you need depending on the application response time or any other external factors.

You can use these global variables, it's very, very efficient way of handling the timeouts, at any different locations within the business objects and the operations that are carried on the external applications. Okay, while doing this, we also touched upon another topic called publishing of business object pages. So, once a business object and all its relevant pages are created, we need to publish them to make them visible to a process for further use. So this is the object studio right. And we before that in our previous chapters, we talked about Process studios. So we reference these objects and their subsequent pages in the process to do in their process flow diagrams, right.

But to make these business objects and its pages available to the process flow diagrams, we need to publish them. Right. So, just to summarize, in the process flow we made, we published them and made them available to the control room, the Business Objects when they are published, then they get available to the process flows. Right. And once we publish them, like we simply right click on that tab, and we publish it. And once you publish them, this fav icon with these three different erasers, colors, the blue, purple and the yellow one, it gets visible and that means your page has been the Bo page has been published successfully.

And if you see if you remember when we created these When you created the business object, then we got these two pages by default, initialized in the cleanup, and they're already published, they cannot be unpublished because these are coming by default, you cannot delete them, you cannot play much around with it except for adding stages in them. Okay. The last thing that we're going to talk about is the action stage. So, now we have understood the way business objects work, we have to use them through the process studio and within the process flow diagrams. So let's open our process flow. We have this new process flow that we have been working on.

And let's stick this out. And in this main page itself, we're gonna first let's say launch the CRM application, perform the addition operation, the writing operation and we are going to terminate the application as well. So we haven't added the terminate page yet. So we probably do that in a minute. But what we're going to do is, if you see, we have an action stage here. Right?

This is the stage which interacts with the business object and its corresponding pages. And because we have divided the different business object capabilities in different pages, we haven't published this one yet. So it becomes easier for us to simply just call these pages and perform our operations, our intended operations. let's publish this as well. Okay, so now we named the action. It might not be available right now the business object.

If you go and see the new business object We only have a state example. Why? Because we opened it in like this instance was already opened. And this we published a little later. So just a second. Just let's saving.

I close down. This one is all good. I'm gonna save this as well. All pages, save changes. I go back to the blue prism, again, the synchronization issue that we were talking about once we go open this large CRM application, and you see all these pages within the Bo the new Bo got available. So we launch a new launch in the CRM application, all good.

And next, we're going to perform the right operation, right. Once the application has been, is opened or launched successfully. So we had another action stage and right data. New Bo. Yeah. And we performed the writing operation, we hit OK.

Here is the link that we have provided in here. And pretty much no errors whatsoever. Now we simply run the program and see if it works or not. So here it is, we are launching the CRM application writing the data, the first name and the address line got added and the program part ended. Pretty simple, right? We differentiated all the operations that needed to be performed in the Bo itself.

And using the action stage at the process flow diagram level, we just referenced those pages within the Bo. Also, similar to the process flow diagram pages, we can send input and output parameters between processes and business objects. in exactly the same fashion, let's reset this and show you. So we can add the input and output parameters at the start and end stage of the Bo pages level. And correspondingly we get those parameters available in here. Right, we can store them locally, play around with them and do multiple things.

All right. So, we have now gone through all major concepts to create a basic functioning but let's put this knowledge to a better use by solving a rather complex use case, step by step. Suppose we have to access all Excel files available in a particular local directory. Copy some few cells cell values from each of those files, and paste them into an output excel sheet will be using a predefined Excel business object to accomplish this process before delving into the actual creation process, It is always a good practice to first create a sequence of steps that must be followed to accomplish the desired result. This methodology corresponds to algorithm creation process, which is highly praised and is the norm followed in programming world. So for this use case that we just discussed.

The Step one is to access the directory where input files are located and get all the file names retrieved. Step two would be to open the output file and keep it aside. This is because if you have to work on multiple input files one by one, rather than opening and closing output file after each paste operation, it's a better way to keep it open and keep pasting values from different input files. And finally close it down once all the files have been worked upon, right. So a quick note is that you always should think of how process would be carried out manually, and then Try repeating the same sequence of operations using the software robot. Okay, step three, start a loop, which will iterate the same number of times as the total number of files available in the input directory.

Step four, access the first input file, go to the relevant worksheet, read each cell value needed, and store it in a variable. This step is good if there are only a few cell values that are to be retrieved. In case the total number of cells is huge. We may copy the entire worksheet, stored it as a collection and retrieve data from it based on the requirements. Right. Step five, go to the output file.

Write the values from the data items into the relevant rows and columns of the Excel worksheet. And the next step is going to be simply closing the input Excel workbook. And once we have pasted, we have closed the Excel workbook, we end the loop. And the final step is going to be to save and close the output Excel workbook. So now we'll go through each and every step sequentially in our blue prism application to see how the process diagram works. So, this is the blue prism program, the process flow where we're gonna work on it, each step by step that we just discussed.

So, first, to access the files within a particular local directory. Let's look at the available blue prism business object that we can leverage, right. So, we take the action, right we give it a name, the any comprehensible name like get files from folder, write the business object as you can see There would be some, which you have already imported. And the one that you're going to use, in this case is going to be utility file management. Right? I'm gonna go to this action in a in just a minute.

First and foremost, I also want to mention that, you know, if you can see this file utility management business object in your process flow within the action stage, then simply go to file, click Import, or you can use the shortcut Ctrl I as well just browse, and here they are the installation directory under the vo folder, you'll see all those XML files that you can leverage. And this is the utility file management XML file that we have to import. For me, it's already imported, so I'm okay to use it. Once imported. Even if you can see it right away, just save your process flow, close it, open it again, the synchronization issue that we talked about So you should be able to see that business object and you can use it as corresponding actions. Or we can call it the predefined functions as well.

So, in the file management, we are going to use get files. So what get files is going to do is it's going to get all the files from a particular folder, right? It's gonna have these folder, and the pattern CSV as the input parameters. So to see that do discuss more on the use case that we're implementing right now, we have a folder called input files, right? And the input files is gonna have some data. I've put in some student data of five different students.

You can also imagine that, you know, there could be like 5000 students data in here, right? So in that case, the benefits realization of implementing a bot doing this work for you would be like huge for the students. It might not but again, we have to build a working solution. And the solution that we're going to build is gonna work for even 500 files. So that should be okay. All right.

So what we do is we put the folder path in this action stage. So here we are accessing the folder, the input files. Here's the location, we can either put it as the double quotes or as a data item as well, both of them work. We put the backslash and the input files, right, this is the folder name. And this is all right. And for the other input parameters, which is the patterns dot CSV, it's gonna it's asking what the pattern of the files if there is a pattern for the files that we need to, you know, get the data from.

So because this is at the file level, so any file, whether it's XML file, Excel file, docx file, notepad file, all the files it's going to take, but if you provide a certain pattern to it, then we should be able to get only the relevant files that we that are gonna, you know, match that pattern that we are going to provide. So, if you see, once you open the input files, all the files have the name dot XLS x. So what you can do is you can use a wildcard star dot XLS x, and that way any Excel file would be retrieved through this process, all the files we're gonna get, we can also put star student data dot XLS x, because all of them have some amount of characters depending on their names. But the student data is written in all the files. So that again depends on the pattern that you have for the files for the business problem that you're solving.

And you put the pattern input parameter accordingly. All right, let's minimize this and also the input parameters alongside those. We Have them output parameters as well, where it's gonna give a success flag whether the retrieval process was successful or not, there's a message that you may want to put in you can you know, any message that it may have the files may have, it can give that as well. But these are like the additional parameters which we are not going to need. We are going to need the files, the file names and everything, all the data corresponding to the files. So we're going to store it in a collection, that's going to be the type and to create the variable ad hoc as we talked about once, they can simply click this button and we got the files, right.

We hit OK. And we have got all the files in this. Let's take this out. We have got all the files in our all the file data in this files collection. Okay, once we have set this up, now, the second the second step that we need to do To open the output file where the data needs to be written, and this is accomplished by using an action stage, let's give it a corresponding name out, but file, create instance. So what we're going to do is to open an Excel file, there's a sequence of steps that we need to follow are for any application usually, first and Mind you, this is actually the process that is followed when you are working manually as well. What happens is, first, you create an instance of the application.

Right? Let me show you how an instance looks like. Like, you know, let's see if you can or if you cannot, or just a second if you're opening Excel, right you know, close versus exit. This As an instance, so the application is still running, but there is no file open. Right? This is how an instance looks like.

So by instance, we don't have any file open. And this is always the first step to start an application. Right? When we are working manually, many times, all these steps are done when we are clicking, you know, right through the application, we replicate the file and the instances open in the back end and we get an optimized process. But the series of steps that follow that follows is we create the instance then we open the file the workbook, and then we show that workbook as well so that it becomes visible, it becomes visible to the naked eye are in front of the screen that you're working on. Right.

So we are going to create the instance and for this we are going to use the MS Excel VBA. Again, a predefined VBA which, if you're not able to see it, you can just go file and import it and you should be able to see all the corresponding actions Right. So in here we go and we choose Create instance. Okay. And in here, once you've created the instance, we don't even need any input parameters and anything because it's a flag, whether the do enable some events or something, which is of no use, but handle is important. So once an instance is created, it generates a handle.

And this handle is gonna be like some alphanumeric, some numeric characters. And based on this handle, like when we are opening an Excel document, we have to provide this handle so that the document can open on that instance. Right. So that's how it is done manually as well. First, the Excel instance is created. Then, when you open the workbook, it gets open on that particular instance itself.

So you need to provide that identifier, which is the handle for that particular instance. Let's create the handle and Probably, I'm gonna make it as output handouts I'm gonna create a new data item output handle number type it okay and output file creating instance. Okay, so we have created the handle now and the stage once we have created the instance, the next step, as you may have guessed, is going to be to open the workbook right which is going to be the output file because we discussed this when we were discussing the steps as well that you want to keep your output file open and do other computations of pasting the data into it, rather than opening and closing the files again and again. For input we are going to open copy and we can simply close them because that's all the function alternated from the input file.

But for the output, we need to do the pasting operation from all the files, one by one, right. So we're going to keep it open rather than closing it again and again. Okay, so we're going to open the file, open out workbook. The business object is going to be MS Excel VBA. Oh, and as you can see, there's an option called Open workbook. In here, it's asking for the handle, which is going to be the output handle.

And we're also going to open the file name. So the file name you're gonna provide us if you remember. Okay, and once you have gonna open the workbook, it's gonna give And output of that workbook name, right, we're gonna use this workbook name, or we may not, again, depends, you can simply create it. Or what I'm gonna do is just for simplicity purposes, I'm gonna create a data item. And I'm gonna make it as output. workbook name.

You should always remember that the data type that you're using for these should be exactly the same as the as the output parameter data type is, right. Here's the output workbook name. And we have the file available like it's opened with this action. Now, once it's open, you would want to show it you would want to make it visible. So the next action as you can see, the MS Excel VBA is actually creating a lot of things for us. It's making our work very, very easy.

Right. So let's Also maximize it to some extent. Okay, so now we're going to show the workbook MS Excel VBA. Oh, and if you're gonna choose the show, all you have to provide is just the handle on the output handle whichever file we have opened, the whole instance is going to be visible. That means we are able to see the file corresponding to that instance. And we don't have any awkward parameters.

So we are all set. Right? With all these steps. Now we are able to open the output Excel workbook successfully. Right now, once we have got all the file names and everything correctly, there's a way we know what you should do is once you're building up program, you can always step through it and see if this is working as per the expectation or not. Right, you can always reset and, you know, make the program, make any changes, any changes you may need in the program.

But let's see if it works or not just you know, a snippet of this whole program is what we are trying to run. So, let's get through it. Get the files from the folder. And let's step out and probably okay, I went way too fast, I guess. As you can see, files got row 125. And I'm not going to reset it yet.

I'm going to show you what all data we got. We can see the current values, we got the path, we got the folder, we got the name of the files, and we got the extension as well and we got the created date time as well. Okay. So we are simply going to use the path right because as you can see, it's got the complete path along with the file name and everything. I'm gonna tell you why we're going to need that because that's the input parameter we are going to use later. But we can't the files data, we got the output file, the workbook name as well, which is output file dot XLS x, precisely right, and we got the handle also generated for the output file, which is gonna direct us to the instance where we will be running our output file.

Right, so up till now the program is running just fine. Okay. All right. So once these steps are done, now we have to start the loop. Because see, what we're going to do is we're going to start the loop where each and every input file, the file name, and the path and everything which we just retrieved. We're going to iterate through each and every file.

We are going to copy that data and we're going to then paste it to the output file, right? So the loop condition or the repetative steps is going to be to access the file and copy data and paste it. This is going to be repetitive for each and every file. So that's why we're going to start the loop now. Here, we got the loop n stage as well. And the collection which one is it going to be?

Files? There's nothing students which probably it might be somewhere around. I don't know. Somewhere in this because we were using the same program in different exercises. Doesn't matter. Okay.

So once we got this we are going to iterate through the collection of these files which means the number of rows which is exactly equal to the number of files that we retrieved will be the number of times the loop will be iterated okay and once we are running this, we are now gonna execute the steps to open the input Excel. workbook, right. So the steps we're going to be following are the same, we can also use the same instance. Because see, every time when you're running, even manually an Excel application, you're not running the instance, every time the instance is gonna be one. And the files can be separate, there could be multiple files running on that instance. So what you can do is, you can just run the instance, open the output workbook, let's not probably show it, that's just one way to do it.

Right? I'm just saying, Let's not show the output workbook. Let's also open the other input workbook, and then show the workbook using the instance handle. And that way, both the files would get visible, right. But we can also use a separate instance it to it's totally fine, it's not going to make a difference. So because I'm keeping them separate and if you know If you are at the convenience of using the memory as much as you want in your depending on the business project that you're in, then having a few data items extra should be okay.

But having said that, if not, then the optimized way would be to use the same instance itself. So excuse me, handle. This is gonna be a numeric type. And we're gonna create instance, let's just copy these three steps. So as you can see, you can put a handle and the file name, instead of these double quotes, the file name is gonna be provided through the collections, right? So what you're gonna do is in here, you might have to bear out a little bit, what you're gonna do is, you're gonna give it as files that so let me just tell you how this works First, let's see we have any, any collection, right?

Which is not of any use in here. So that's how we use the different columns of an are different fields of of a collection, right? We give the collection name, and the field name. So we're gonna use it like files dot bat. How do you come up with this? Let's open this again.

In the current values, you can see this is the path which is given this is the data type corresponding to this field. so files dot path is going to be able to retrieve the first or whichever row the collection is on right now. So because by default it's going to be row one of, of this file is collection. So that will be retrieved. Right? And we're going to open that workbook.

And we're also going to create an input workbook name, which, okay. Okay, spelling mistake. And in here. I haven't changed it yet. Just give me a second. Since I opened this, we're gonna use input Name St.

Here. Okay, so we're going to open the input workbook and we are going to show the input workbook as well. Right? Once we do that, we are going in a very legible sequence, right, all the steps that we discussed about we are following each and every step over there. Now what we're going to do is we're going to copy those, the cells, the required cells from the Excel workbook from the input Excel workbook, and we're going to paste it to the output sheet, right. So for this, right now, up till this step, we have the output XML file open and the input XML file.

So right now, what we're going to do is, let's open the input file for a second, any input file, I'm going with the assumption that all the input files are exactly the same in terms of their structure. And the output file also opened which is completely blank. So keep minimizing it for now. This is how the input file looks like. You can also see it or else when we were running the program, you'll see each and every file. Okay?

So we have the student name and their marks in the class in the section. Let's say we only want name and the marks in the output file. Just taking a hypothetical example here, right? So, what we are going to do is we are going to go to MS Excel VBA. First and foremost, let's say that, you know, there might be different worksheets in a workbook, right? So, sheet two, sheet three could be there as well.

So first and foremost, you want your bot to be pointed to the correct worksheet, so that the copy paste copy operation works in the correct worksheet. Right. And similarly is going to be for the paste option as well. We want the paste operation to be performed on the correct worksheet. Right. So you go to a particular worksheet.

This is what we inherited. We're going to go to the action stage go to input worksheet, right. And in here in the Excel VBA do we choose Select. So what select is going to do is it's going to select the corresponding, you know worksheet based on based on the work that is open. So what we're going to do is we're going to simply put the handle for the input file because this is what the input file we're working on. We're going to put the input XL handle, right, if it would have been the same input and output handle, we could have put the handle that's okay because the workbook name is gonna take care of we cannot have the same workbook name as well.

So that should that should work. Okay, so for the input, workbook name, we're going to use the input workbook name right from here. In work, here it is. Let me just check I didn't copy twice. Yep, it didn't. And for the worksheet, so the worksheet name could be anything, right, but in here, it's sheet one.

So I'm going to put it I'm going to hard coded as sheet one. And cell references like which cell you want to refer to to select, right? And you put in anything, a one doesn't matter because it's going to go here. But you know, we are going to copy and when we are going to copy any cell value, we're going to provide the cell reference there itself. Okay. So what we did is, we went to the corresponding worksheet, and we are there now, right as per the bar.

If you're doing it manually, you can see that you are now on that particular worksheet where you want your operation of copy to be performed. All right. Once you're in the input worksheet, then the next hour that you want to perform is getting the cell value, right. So get cell value, something like that. And MS Excel excuse me, MS Excel ppl and we get the cell value right in here, it's the get cell value is the action which is only going to need the handle. So we simply use the input handle, and we provide the cell reference as well.

So that's one reason why I kept the input and the output Excel handle separate. Because if I have a different handle number, then only that particular file would be accessed. Right? So it's a decent practice if you want to do it, if not still because the active file would be the last input file which you just selected in this action. In this activity in this stage, so, either way, it's gonna work, it's gonna work for sure. Right, and for the cell reference, let's put the value as because you want to access the name right?

And the value of the name, it's gonna be a two. If you click here you see cell references a two. So I'm going to hard code it for now. Right? And the output, we're going to store it in a value, right in a data item. So I'm going to create a data item called name.

And it's got to be of type text. No initial value as such. I'm also going to create a data item for marks. Okay, so I have the gifts let's change it to get name We got through the a two we got the name, and the value is gonna be stored in this name data item. Right, so we got the name now the next action that we want to perform is get the marks simply copy and paste it, change the name get marks, instead of eight two, this time it's gonna be D two. So we change it here.

And instead of storing the data in this name variable, we're gonna store it in the marks variable, get item All right. So now, we have successfully if you can see copied the data from the input worksheet, whatever was needed. And two ways now we can we can proceed with either we perform the copy the paste operation in the output file, or we can simply first close the input workbook and then perform the action Right. So either way is fine because it's just one step involved. So what we're gonna do is, let's, let's work on the on pasting the data in the output sheet for now, right? It's not gonna make a difference, but just showing how it works.

So let's put it somewhere around here or okay? basting value, name value. Okay. And we choose the MS Excel VBA Oh, right and in here, we are going to choose and see you can learn about these actions by playing around with them by you know, just choosing which one works. If you want to see the paste, you will see what are the values you want to print, what are the workbook name and what is their handle number you want to print and all that stuff and it's going to print the value but For this, I'm going to use sec cell value. Because we're sending to from one cell from the input workbook, we are setting the value to the output workbook, a particular value, right, which is already stored in the data item.

So this time, we are setting the value in the output worksheet right in the output workbook. So we use the output handle, what's the cell reference where you want to print, that's a little tricky. I'm going to go to that in a minute. and the value that you want to print is the name. So let's put name here. Just hit OK.

So now let's open the output sheet for a second and see how this works. So during the first iteration, you want the data to be in the forest. In the first step itself, write the name and similarly, when the next iteration would be there, you want the data to be in the second in a row. So you want this also to be iterated. So the set Reference should automatically I trade based on the number of iteration that is being performed within the looping statement. hope that makes sense, right?

And this is starting from one if you want it from here, we decided from two as well if you want to put some headers or anything, but then started from one just to see how it works. Okay, so what we're gonna do is we're going to start, we're going to put another data item, we're going to name it as counter. Okay, of numeric type with an initial value of one. Why? Because he got it right, we want to start from the first value itself. Okay, once we did that, we go to pasting one to go to the cell reference, let's use an expression editor.

Right. And in here, we want the value of a gives me a right and we want to put the the next number to this A, the cell reference needs to be that counter variable. I hope that makes sense, right because we will be trading through it, but the column is going to be the same we wanted in the first column itself of the output file, and the marks is going to be the second column. Right. So to concatenate, you can see, we go to the text functions, we use the concatenate, and what you can do is simply put the values here, and the option B is going to be the counter variable, right, simply paste it and your function is our expression is automatically generated. So just to summarize, these are the inbuilt functionalities but to concatenate two strings, we use the AND operator, right.

And if you don't know about any operators, I highly recommend to use these inbuilt functionalities because they really come handy. And they are divided very neatly so you can play around with this and work accordingly. So, we have a n counter, we also added the expression which is valid, we hit OK. And every time a one or like the counter is going to be incremented again and again. So, we will be simply setting the value of this a counter variable with the name data item, right? No output because the output or the action is being performed on the output excel sheet. Okay.

Another thing that we should have done and we are pretty much going to do is we're going to go to the corresponding worksheet have the output workbook as well. But since once you open the output file, if it is just only one worksheet is available, then it's okay not to provide it but in real life scenario, there might be like hundreds of worksheets. So you always want to direct your bot to the correct worksheet so that you are able to proceed From your computations correctly, right? So it's, it's okay, it's okay to continue with this this arrangement. All right, we have pasted the name value Let's face the marks value as well output handles still the same, we want to put this in the second column and the value is going to be marks okay. Once we did that, the next step that we are going to follow is going to be to close the input workbook right we have got the cell values now we have gone to the output worksheet as well and pasting the values.

And now let's close the input file. So to close we go to the MS Excel Review. And we're going to close workbook. Right. And in here, we simply provide the handle and the workbook name, which is the input one. So input handle if it was same, the same handle for input and output doesn't matter.

And for the workbook name, that has to be different, right? For sure. So input one book name. That's it. Right? No output because it's again working directly on the application itself.

We don't want to save data flag or anything, this is gonna get the operation done. And before we go further, we also do want to increment the counter variable, right, because next time we want our data to be incremented to be the operation to be performed on the next row. So we have done this step multiple times. So And so just gonna increment the counter and it is gonna go back to the loop where our operation would be performed again, right, if we go back to the looping start itself, the operation will be performed. And correspondingly once it's done, it's gonna start off with the second file and there all right, once all the files will be done, it will come out of the loop, the program will come out of the loop, and once it is out of the loop loop, that simply means that all the files have been retrieved and their copy and the subsequent paste operation has been performed.

Once this is performed, the last step that we want to do is simply close the output workbook. You can either close the instance close the workbook, doesn't matter. Depends what you want to but either way, this wind output workbook name, and we hit OK. So we have our complete process flow ready. And let's close these files. Okay, and if you made any changes or not, but we close this file, we close the output file as well.

And we're going to see how the program works by resetting it and running it in a medium pace, which is probably what is by default, a little faster. We can perform it as fast as we want. If there's going to be any problem, you're going to debug it as well. But this seems like a pretty sophisticated program, right? I hope it made sense logically as well. And here we go.

So we got the files from the folder, we can see the files collection, we opened the output We show the workbook which is visible now. And we open the input workbook we show the input workbook as well this is the first one here we got the col 94 all been copied automatically it pasted the file in the output one, the data. Now again went back open the second workbook with this name and these marks copied and you see pasted. Okay, next file showing the workbook now, name is Kevin March 278. copied, close the input workbook and paste it. Alright, next, it's opening a workbook. This fourth one name is Smith, and the marks are 74 copied, closing the input workbook and paste it already.

Last workbook is the input workbook is going to be for Smith. Here it is. Alright. So that's how it worked out. And as you can see, the process was pretty fast, pretty smooth as well. No issues were there.

And as easy as it is, because see, I also show you in the vibe of student data, we put the data Smith itself, so I should have probably changed it to make the difference. But whatever was there in the file, because every time the file got opened, this data was shown and I talked that I changed the data, but it worked out. Right, whatever is gonna be the input is simply in the output file as well. All right, so you can imagine the benefit if you're working with 500 500 files, and if you're working with way too many fields right now, we just took two fields, right? If you're copying The entire worksheet are subsequent pages and, and a lot of computations, then you can use these methodologies these practices and you can get a very decent process flow diagram and perform a lot of computations very, very efficiently.

Another practice that we should be performing is or under recommended practice in real time projects is to divide this whole workflow, like you know all the input workbook operations in a separate page and say the output book operations in a separate page and simply use the page references in your main main page process flow. Right, that's a recommended practice to make the program more manageable and tidy and comprehensible. Alright, so that's pretty much it. Please do complete the exercise too as well which is attached with this lecture. And this should suffice with the basic understanding of what Blue prism is and we're gonna go with the sophisticated features and more additional capabilities in in the subsequent chapters.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.