I have a unique situation i need help with. I am a beginner and my automation logs into A desktop application and navigates to a screen where it searches for a different hospital for which a report needs to be run once searched and then the report is pulled out and put into excel. I am having trouble figuring out how to loop this to search for the different hospital each time but then perform the same actions of pulling the report. (I do not have an excel list of the hospital names i need to loop through but can create an excel if needed for automation). I am also getting an error trying to pull the data bc this is not in a table format and cv screen scope is giving issue of INvalid UI node. I added the automation below and highlighted the step that needs to be different everytime. Please help!
There are multiple ways to handle this:
If your requirement is to search a different hospital each time you run the automation, then you can simply define hospital name as asset and then based on the name defined that asset, you can run your workflwo.
if your requirement is to search for different hospitals within 1 process run, then you can either go with excel to define the list of hospital names, then pull the names to loop through them or consider using queues here to save those hospital names.
You can also consider defining an asset for multiple hospital names in json format, then deserialize json to fetch all values and loop through.
As for CV screen scope - ui node error, i have commented on your other post regarding that error to re-indicate the scope, it should work.
Regards
Sonali
thank you @sonaliaggarwal47 I want to loop through in one process run. since i am new to this would you be able to provide a screenshot of this for me. What activity can i use or do I keep the ‘type into’ activity and replace the type into with the excel file?
Asset is like a variable that you define in orchestrator whose value is picked at runtime.
Attaching few doc FYR that should help you gain more understanding on assets:
Regards
Sonali
thank you @sonaliaggarwal47 I want to loop through in one process run. since i am new to this would you be able to provide a screenshot of this for me. What activity can i use or do I keep the ‘type into’ activity and replace the type into with the excel file?
@alexandra.wickel
Follow the below steps
Create an excel file with all of your names.
- read that excel, store data in dtInput variable
- open browser
- do login setup if required
- use for each row in data table activity, pass that dtInput variable in this activity
- inside for each row in datatable use type into activity to search the hospital.
- extract the data by using your methods
- store it in datatable or you can write that data into your excel files
- go back to search screen by using search screen URL or any button click if avaialable on screen
It can loop you process untill al hospital names are completed from your excel
Happy Automation!!
Hey @alexandra.wickel you are saying that you want to use a loop that been execute for the hospital name so for this you can create a list or array variable and store the data in the variable the use For Each activity or if the data store in excel file use read range and then use for each row and inside that use the all **UI Automation ** Activity .. i give you an overview of that project hope it help.
Read Range → HospitalNames.xlsx (HospitalDataTable)
2. For Each Row in HospitalDataTable:
- Assign:
HospitalName = Row("HospitalName").ToString() - Type Into: “[SearchFieldSelector]” =>
HospitalName - Click: “[SearchButtonSelector]”
- Get Text (or OCR) to extract report data
- Write Range to Excel to store extracted data
- Continue to the next row
thank you so much it is working … to add on to this issue I want to add a column to the data that pulls the hospital name in which is the same as the excel i am using in the beginning to search what can i use here to add the hospital name for each data set? (if i should open new thread let me know)
Hi @yedukondaluaregala thank you I used this process, however the table extraction will not extract the data everytime and put into excel. Any suggestions?
If you write the data to Excel inside the loop, it will overwrite the existing data each time, leaving only the last extracted entry. To retain all data, place the Excel writing activity outside the loop.
Alternatively, you can pass the hospital name into the ‘Destination’ field —this allows the bot to create a separate sheet for each hospital, preserving each dataset individually.
@iampnkz I have the append option checked which allows the data to paste into the next empty row. If I wanted them to go on separate sheets each time what would I put in the “destination” field? Data.Sheet(“SheetName”)? There is also the issue of it not finding the table when it re searches for the different hospital it seems to break the extract table data activity bc the table changes.
My workflow is as follows:
- log in to application
- perform series of click/type into’s to get to search screen
- ~Inside for each excel row activity~ search for hospital (which is being pulled from excel)
- extract table data
- finally, use excel and write data table to excel.
while using extract data table check selector whether it all getting all the data or not.
whenever you dargged that activity or trying to indicate there is an option preview check whether you are getting all rows or not.
for reference go with below video
and make sure each iteration you should write new excel sheet or use append activity to add all the data without over writiing.






