Steps to read data from column B based on data in column A:
Read Excel Data: Use the “Read Range” activity to read the entire Excel sheet into a DataTable.
Loop Through Rows: Use a “For Each Row” activity to iterate through each row in the DataTable.
Access Column A Data: Inside the loop, use the row("ColumnName") syntax to access the value in column A for the current row.
Read Corresponding Data from Column B: Use the value from column A to determine which row of column B to read.
For example:
Drag a “Read Range” activity into your workflow and configure it to read the Excel file into a DataTable variable, let’s say dtExcelData.
Add a “For Each Row” activity and set its DataTable property to dtExcelData.
Inside the loop, use an “Assign” activity to get the value from column A for the current row: valueA = row(“ColumnA”).ToString()
Using the value from column A, find the corresponding value from column B: valueB = dtExcelData.AsEnumerable().Where(Function(x) x.Field(Of String)(“ColumnA”) = valueA).Select(Function(x) x.Field(Of String)(“ColumnB”)).FirstOrDefault()
Replace “ColumnA” and “ColumnB” with the actual column names in your Excel sheet.