I have an application and an excel. In that excel, i have some name of ten companies one by one in each row. I have recorded a sequence of steps to be performed in my application. While running that recorded sequence, at one of the steps in the middle, robot has to go to that excel file and fetch the name of the first company and should come back to application to paste the name of selected company from that excel and do the remaining process under that recorded sequence. Once the process of recorded sequence completes, it has to repeat the same process with the next companies name present in the excel.
How can i make the bot to read each cell from the excel ? And thereby to store it under some variable to perform further recorded sequence.
Use Read Range activity to read the data from excel file and will give you output as DataTable and say âDTâ. And then use For Each Row activity to iterate one by one row.
ForEach row in DT
pass row(âColumnNameâ).Tostring to that application.
Fine
Hope these steps would help you resolve this
âuse EXCEL APPLICATION SCOPE and pass the file path of excel as input
âinside the loop use READ RANGE a activity and get the output with a variable of type datatable named dt
ânow use a FOR EACH ROW activity and pass dt as input
âinside the loop use OPEN APPLICATION where mention the file path exe file of your application or START PROCESS activity where mention the file path of application exe file so that it will open the application
-that is we are still inside the for each row loop and if open application keep with that the set of activities to be performed in that application or if itâs start process keep the set of activities next to that start process but both cases it should be inside the loop
ânow to access the column and row value use this expression row(âyourcolumnnameâ).ToString which will get the value of a particular column at that row which is under iteration
âatlast inside the loop use close application activity to close that app if you want so that when the iteration goes for next row it will open the application freshly pressed or if itâs fine use send hot key activity with back key so that it will take us back to the home page like how we do in keyboard
âso once after this row value gets entered to the application the loop will take us again to the next row and it goes on