System.Activities System.Activities.Statements System.Activities.Expressions System.Activities.Validation System.Activities.XamlIntegration Microsoft.VisualBasic Microsoft.VisualBasic.Activities System System.Collections System.Collections.Generic System.Data System.Diagnostics System.Drawing System.IO System.Linq System.Net.Mail System.Xml System.Xml.Linq UiPath.Core UiPath.Core.Activities System.Windows.Markup System.ComponentModel System.Runtime.Serialization System.Xml.Serialization UiPath.Excel UiPath.Excel.Activities System.Activities Microsoft.VisualBasic mscorlib System.Data System.Data.DataSetExtensions System System.Drawing System.Core System.Xml System.Xml.Linq PresentationFramework WindowsBase PresentationCore System.Xaml UiPath.System.Activities UiPath.UiAutomation.Activities System.Runtime.Serialization UiPath.Excel.Activities UiPath.Excel.Activities.Design UiPath.Excel True [dt_result] [dt_main.Clone()] [dt_result] [(From row In dt_main.AsEnumerable() Let zipCountCountry = dt1.AsEnumerable().Where(Function(w) row("ID").ToString.Trim.Equals(w("ID").ToString.Trim)) Let pin = dt2.AsEnumerable.Where(Function(w) row("ID").ToString.Trim.Equals(w("ID").ToString.Trim)) Let firstCond = If(zipCountCountry.Count.Equals(0), False, True) Let secCond = If(pin.Count.Equals(0), False, True) Let ra = New Object() _ { row("ID"), If(firstCond AndAlso String.IsNullOrEmpty(row("Zip").ToString),zipCountCountry.Select(Function(s) s("Zip").ToString).First(),row("Zip")), If(firstCond AndAlso String.IsNullOrEmpty(row("Count").ToString),zipCountCountry.Select(Function(s) s("Count").ToString).First(),row("Count")), If(firstCond AndAlso String.IsNullOrEmpty(row("Country").ToString),zipCountCountry.Select(Function(s) s("Country").ToString).First(),row("Country")), If(secCond AndAlso String.IsNullOrEmpty(row("Pin").ToString),pin.Select(Function(s) s("Pin").ToString).First(),row("Pin")) } Select dt_result.Rows.Add(ra)).CopyToDataTable()]