Compare 2 sheets and use in verify activity

Hi All,

I have attached excel sheet.

  1. In Sheet " Course Content" i have values starting from ROW4 to compare.
  2. In Sheet " Sheet1" I have values starting from ROW 2 to compare. the values in sheet2 is dynamic and in each loop the values changes.

i have to compare values from “Sheet1” to “Course Content” and use that in verify activity to make it pass or fail.

How to do it.
myers14e_Course Building Grid - Copy.xlsx (22.6 KB)

Hi @shruthi_arali -

Read data into two datatable for both respective sheets.
add for each loop on content course data table and inside the loop, add for each loop for sheet1’s data table, check the values for respective columns are matched or not.

Excel Application Scope - “YourExcelFilePath.xlsx”
Read Range - “Course Content”
Output: dtCourseContent
Read Range - “Sheet1”
Output: dtSheet1

For Each Row - dtSheet1
Assign - valueSheet1 = row(“ColumnName”).ToString
Assign - valueCourseContent = dtCourseContent.Rows(dtSheet1.Rows.IndexOf(row))(“ColumnName”).ToString

   If valueSheet1 = valueCourseContent
            Log Message - "Match found, pass"
            Log Message - "No match, fail"

I want to compare the data from “Sheet1” from Row2 and " Course Content" from Row4.