used use excel file activity inside excel process scope & inserted column. used for each excel row activity & used write cell in then block . After that used if condition to check another sheet which is outside excel scope rows & current row of excel. then used write cell. At this step throwing error.
Can anyone please help?
@vnsatyasunil
Can you share the scrnshot of the file and the error
scenario is in reframework init i have filtered datatable which needs to be added to sheet2 of excel.In this excel column status needs to checked i.e here value is yes.
then in process again extracted data & added to sheet3 excel. Then filtered and added to sheet2 excel.
need to check sheet3 & sheet2 excels if column status is same or not?
From sheet2 excel need to check column status if it is yes or changed to no.
If it is yes one column need to be added with comments as status is yes
if it is no, then add comments as status changed to no
Please help
Try this
- In the Init state of the REFramework, read the filtered DataTable into a variable using the “Read Range” activity. Let’s call this variable
filteredData
. - Use the “Excel Application Scope” activity to open the Sheet2 Excel file.
- Use the “Write Range” activity within the Excel Application Scope to write the
filteredData
DataTable to Sheet2. - Transition to the Process state.
- Read the data from Sheet3 into a DataTable variable using the “Read Range” activity. Let’s call this variable
sheet3Data
. - Use the “Excel Application Scope” activity to open the Sheet2 Excel file again.
- Use the “Read Range” activity within the Excel Application Scope to read the data from Sheet2 into a DataTable variable. Let’s call this variable
sheet2Data
. - Use a “For Each Row” activity to iterate through each row in
sheet2Data
. - Inside the loop, use an “If” activity to check the value of the “Status” column in the current row. If the value is “Yes”, add a comment in a new column called “Comments” using the “Add Data Column” and “Assign” activities.
- If the “Status” value is “Yes”, set the comment as “Status is Yes”.
- If the “Status” value is “No”, set the comment as “Status changed to No”.
- Use the “Write Range” activity within the Excel Application Scope to write the updated
sheet2Data
DataTable back to Sheet2. - Use the “Excel Application Scope” activity to open the Sheet3 Excel file.
- Use the “Write Range” activity within the Excel Application Scope to write the
sheet3Data
DataTable back to Sheet3.
Hope it helps!!