Robotic Process Automation (RPA)

 View Only
  • 1.  DataTable - CSV Load

    Posted Tue January 12, 2021 07:41 AM
    Hi there

    I am writing a bot that consumes a CSV file and I have the data into a DataTable. Its all there and it looks great.

    I am trying to figure out how to loop over that DataTable as for each row I need to update columns that are empty. I have looked through the DataTable package and the Control package but do not really see a way to do this. 

    I assume that I have to use a for or a for each just wondering if there a proper pattern for this?

    Thanks

    ------------------------------
    Troy DesBarres
    ------------------------------


  • 2.  RE: DataTable - CSV Load

    Posted Wed January 13, 2021 05:28 PM
    Dear Troy,

    You are right, for this we will need to loop through the DataTable with either For or For Each loop.

    What I usually do:
    1. use a For loop with an iterator variable to loop through the DataTable 
    2. use Map Table Row to map the column to corresponding variables
    3. to check if a variable is empty/null value, you can consider the Empty or Null Text Variable command

    I have some screenshots below for reference.

    ------------------------------
    JENNY KHUC
    ------------------------------



  • 3.  RE: DataTable - CSV Load

    Posted Wed January 13, 2021 08:12 PM
    Hi Jenny this is great stuff exactly what I needed 

    Thanks
    Troy

    ------------------------------
    Troy DesBarres
    ------------------------------