I have a workflow using excel
i would like to insert a column if this “industry” is not found in the column header.
under Use Excel file
i put a if condition as
Excel.Sheet(“Sheet1”).Address.Contains(“industry”)
but it is not working
the output turn out, it keep adding industry column
Note: i did not put read activity and did not put for each activity
Excel.sheet.Address will give the cell address or the range address of the sheet like A1:G23 etc and not check the value is present or not
Try like this in the if condition…this will read all the columns and check the column names contain industry or not
(From dc In Excel.Sheet("Sheet1").DataTableValue.Columns.Cast(Of DataColumn) Select dc.ColumnName).ToArray().Any(function(x) x.Trim.ToLower.Contains("industry"))
it still insert industry even though there is this column.
(From DataColumn In Excel.Sheet(“Sheet1”).DataTableValue.Columns.Cast(Of DataColumn) Select DataColumn.ColumnName).ToArray().Any(function(x) x.Trim.ToLower.Contains(“industry”))