To be able to run this example you need to install UiPath.Excel.Activities. See more details on how to install packages:
This sample extract from an Excel file two DataTables and compare each cell from the first DataTable with the corresponding cell of the second DataTable.
Steps to automate
- Read Sheet1.
- Read Sheet2.
- Get the number of columns and rows for each sheet.
- Check if both DataTables have the same size.
- If their sizes are the same then compare the elements.
- In case of identical DataTables display a message like "DataTables have the same information".
- Otherwise display a message like "DataTables are different!".
- Read both sheets and convert them into DataTables using "Read Cells Range" activity.
- Get the number of columns and rows using the name of the table and ".Rows/Columns.Count".
- Use a "FlowDecision" activity to check if both DataTable have the same size.
- If their sizes are the same then compare the elements using a "While" activity, a columnIndex and a rowIndex.
- Display a message using "Message box" activity to inform the user regarding the result.