Excel fetch values

Field-WPS Office.xls (10.5 KB) I have attached a smaple excel .in this excel I need to fetch value from column name date1 date2 and date3 and store it in another excel.that there date column is dynamic sometimes I will get the only two columns(date1 and date 2) or more than(date1 …daten) that how to identify how much date column is present and fetch it’s corresponding value

You can read the Excel as DataTable and Iterate through Columns to get the column names.
-User ‘For Each’ Activity (Change TypeArgument to ‘System.Data.DataColumn’)
Give youtDT.Columns as Value
-Inside this loop can print the column name as item.ColumnName

Hi @sruthesanju

Did u need to take that entire column of date and store in another another datatable?

Date1 date2 date2 columns is dynamic column .in this excel I have 3 date columns in future it may contains two date columns or more than that how to identify and fetch the values of date column

By the method guided above… you will get Column Names in a List.
Column Names can be dynamic… doesn’t matter.

Once you have the list of columns Names,
Use ‘For Each Data Row’ and get values of the date columns you need (You have the Dynamic Column Names in the List. Use it)

1 Like

image_2021-03-05_224207
use getcellname activity image_2021-03-05_224352
it will store your column name in dictionary then run for each with dictionary key value pair


Main.xaml (7.6 KB)