In real-world automation, you often need to compare data from two different Excel sheets—for example, matching orders with their shipment records. UiPath makes this powerful and elegant using LINQ queries.
The following LINQ expression joins two DataTables (dtOrders and dtShipments) on the OrderID column and creates a combined view of matched records:
(From order In dtOrders.AsEnumerable()
Join ship In dtShipments.AsEnumerable()
On order(“OrderID”).ToString() Equals ship(“OrderID”).ToString()
Select dtJoined.LoadDataRow({order(“OrderID”), order(“Customer”), ship(“ShipmentDate”)}, False)).CopyToDataTable()