How to Fill Varying Excel Data into Web App Fields with Looping

Hello UiPath Community,

I am facing a challenge in my automation project and could use some guidance on how to approach it effectively. I’m working on a workflow where I need to fill data from an Excel sheet into a web application’s fields. The complexity arises because the data in the Excel sheet varies from one row to another, and I want to ensure that all required data for a specific task is filled before moving on to the next one.

Here’s a brief overview of the scenario:

  • The Excel sheet contains data for multiple patients.
  • Each patient may have a different number of treatments recorded in the Excel sheet.
  • I need to automate the process of filling the web application fields with data from the Excel sheet, ensuring that all data for a particular patient’s treatments is filled before moving to the next patient.
  • I also want to implement checks for data completeness before advancing to the next treatment.

I’m using UiPath Studio, and I’m looking for advice on the best approach and workflow design to handle this dynamic data scenario efficiently. Any suggestions, sample workflows, or guidance on how to structure my automation project would be greatly appreciated.

Thank you in advance for your help!

1 Like

Duplicate

1 Like

Hi @Aditya_Nalawade

Read Range
currentPatientIndex = 0
currentTreatmentIndex = 0

While (currentPatientIndex < DataTable.Rows.Count)
    Get Patient Data(Get Row Item)
    Check for Patient Change(Compare the current patients data with the data of the previous row to determine if a new patient is encountered.)
    While (currentTreatmentIndex < DataTable.Rows.Count)
        Get Treatment Data
        Fill Web Application Fields
        Increment Treatment Index
    Increment Patient Index

Hello @Aditya_Nalawade

  • For Each Row in DataTable
    If CurrentPatient <> PreviousPatient
    Reset Treatment Variables
    Fill Web Application Fields with Data from CurrentRow
    If Data is Complete and Accurate
    Advance to the Next Treatment
    End If
    PreviousPatient = CurrentPatient
    End For Each

Thanks & Cheers!!!