I have 2 excel sheets like sheet1 ( column - Account Number) and sheet2. ( Columns - Account Number, Contact Name and Customer Number)
In sheet1 have account number,. So, i want to check the same account number is available in the sheet2 or not?
If account number is available, i want extract the Customer Number and Contact Name data in the sheet2 based on the account number.
lst_dtSheet1 as List(of String) = (from rw in dtSheet1.Enumerable() select x = rw("Account Number").ToString)
lst_dtSheet2 as List(of String) = (from rw in dtSheet2.Enumerable() select x = rw("Account Number").ToString)
lst_acc_not_available_in_sheet2 as List(of String) = (from acc in lst_dtSheet1 where not lst_dtSheet2.Contains(acc) select x = acc)
dt_new_Available_account_in_sheet2 as DataTable
dt_new_Available_account_in_sheet2 = (from rw in dtSheet2.Enumerable where lst_dtSheet2.Contains(rw("Account Number").ToString)).CopyToDataTable
Note: Please consider above for logic only. Code accordingly in UiPath.
If you face any issue let us know
Get column value filtering by another column
1-Validate if there are results under the Linq filter
2-If there are results then get the required value
3-If there are not results, then assign String.Empty