I have literally tried everything. I feel too defeated to explain all the ways I have been attempting to manipulate this process, but currently trying to write “completed” in row J (“Status”) to skip completed and continue with activities if currentRow J is blank. Not working either. I can’t even get the activity to write “completed”.
I am using read range to For each row in data table. I have read so many forums and documentation and get steered to do so many different things. Please help.
my data in google sheets name, date, and time are in the same order as it is on the webpage. I don’t understand why I need all of these extra things to select a corresponds appointment. I’ve tried a row counter, get text, extraction, find element…others…it still repeats the same row over and over. I have tried so many ways to handle dynamic selectors (which is where the problem seems to be, or maybe workflow layout. I don’t know. I don’t know how to solve this.
Hi @DR_pathUser,
Read the Excel once into a DataTable, loop through the DataTable, update the DataTable in memory, and only after the loop write the DataTable back to Excel.
Inside For Each Row:
Check
If String.IsNullOrWhiteSpace(currentRow(“Status”).ToString)
then set
currentRow(“Status”) = “Completed”
Do not use Write Cell or Write Range inside the loop.
It seems that the datarow variable you are using is different, that’s why the formula is giving error. I have used “row” as a datarow variable, it could be different in your case.
Please share the screenshot of the logic & variables you are using, that would help in fixing the error.
Also, If your data is in google sheets:
Use google workspace scope → Find Files and Folders → Download File
Read the downloaded excel as datatable.
Or
Read the google sheet as Datatable.
Iterate through datatable using - For each datarow in datatable.
I don’t have an array. I am trying to figure out how to make a dynamic selector that changes position for each row with the google sheet order the same as the webpage appointments. I would like to use my rowIndex for my data table Sat_Dt with a counter. I’m stuck trying to figure out if I need to extract the data from the webpage to match with my google sheets (but that seems counterintuitive of a dynamic selector so it keeps coming back to this). I have tried to replace my aaname= with {{CurrentName}}, CurrentRow(“Name”), ‘{{Name}}’…so many ways. I think the index is the best option. I don’t have a tableRow in my selection though
This issue usually occurs when the loop is always reading the same row instead of moving to the next one. Inside the For Each Row activity, make sure you are not using dt.Rows(0) or any fixed index, because that will always pick the first row. You should always use the loop variable like row("ColumnName").ToString.
Another common reason is modifying the same DataTable inside the loop by adding or removing rows, which can cause the loop to behave incorrectly. If you need to change data, first create a copy of the DataTable and loop over that. Also, avoid using Retry Scope or unnecessary Continue statements inside the loop, as they can repeat the same iteration. If your Excel data is changing during the workflow, read the file again so the DataTable is refreshed. Finally, check that the For Each Row TypeArgument is set to System.Data.DataRow.
I need to select the first appointment on a webpage, create a progress note and fill it in with data from the first row, do a series of activities to complete the note, then return to the appointment page, select the second appointme,nt and do the same the row 2 and so on. It always comes back to selecting the same appointment
Try this,
Before looping, extract the appointment list (using data scraping or Get Text) into a DataTable or list. Then, inside the loop, click the appointment using a unique identifier from that data (such as appointment time, patient name, or ID) in the selector. Do not rely on a fixed or positional selector alone. Each iteration must re-identify the appointment using unique data so the correct item is selected every time.
Ive tried that too. I can’t figure out the selector situation. I see so many variations. I can’t figure out the default value either. CurrentName = CurrentRow(“Name”).ToString
The selector variations are not the problem as long as the field is being highlighted correctly. You don’t need to change them. The default value is only for preview and has no impact at runtime. Just assign CurrentName earlier as CurrentRow(“Name”).ToString and insert the CurrentName variable into the field. UiPath will populate it at runtime automatically.
so extraction doesn’t happen inside the loop? Thats confusing because I need the browser to connect to the data for extraction. I am using one browser. You’re saying I need 2 browser activities, one outside and extract, and another with activites to create and fill in appointment inside the loop? Or can I use one browser and put it before my For each row in data table?