Hai Team,
I have 2 excel files one is input file and second is Tracker file which contains some excel data Rejection Name,Actions
My goal is to I need to check Rejection NAme I have in Input file is present in Tracker file or not if it is present then I need to extract the Action item of that particular column
Eg:-Lets consider the input Rejection name is present in tracker file in the 10th column I need to extract the action item of 10th column how to do it.
first I need to check whether the rejection name is present or not then I need to extract the action of that particular column.I have nearly 80 rejection names in tracker file
a. Get Rejection Name from the current row
b. Use DataTable_Tracker.Select or LINQ to check if the Rejection Name is present in Tracker file
c. If present, extract the Action item from the specific column
Store the results in a new DataTable or any suitable data structure.
Or
You can use excel as DB where you can use select statement to find the rejection name is present in the file or not.
You can use the LINQ Expression to get the Action column values if it matches with the Rejection Name.
→ Use the Read range workbook activity to read the Excel1 and store in a datatable datatype variable, let’s call variable name as dt1.
→ Use one more Read range workbook activity to read the Excel2 Tracker file and store in a datatable datatype variable, let’s call variable name as dt2.
→ After that use the assign activity and create a List of String datatype variable, let’s call the variable name as List_Actions and in the value field give the LINQ Expression.
- Assign -> List_Actions = (From row1 In dt1.AsEnumerable() Join row2 In dt2.AsEnumerable() On row1.Field(Of String)("Rejection Name") Equals row2.Field(Of String)("Rejection Name") Select row1.Field(Of String)("Actions")).ToList()
In the List_Actions Variable it stores all the Actions row items which meets the condition.
→ You can use for each activity to iterate the List_Actions Variable to get the each item in the collection.
Note - In LINQ Expression change the column names based on your input.
Check the below workflow for better understanding,