Dynamic Column Reading

I have to read the column names from the datatable, the column names are dynamic. For example, basing on the drop down for the week, the columns names will change accordingly.
lets say, week is from 01/02/2021-07/02/2021, the column names will be
Mon 02/01 Tue 02/02 Wed 02/03 etc.,
How to retrieve the column names from above kind of scenarios

Welcome to the forum.

we can retrieve the columnnames from datatable as following:

Assign activity
#leftside arrColNames (DataType: String Array)
#rightside: YourDataTableVar.Columns.Cast(Of DataColumn).Select(Function (x) x.ColumnName).toArray

In case of the columnnames are retrieve from the UI (Web /App) then let us know more details on this (Apptype, Screenshot…) Thanks

Can you provide an example. Even i didn’t get the point Select(Function (x) x.ColumnName).toArray


find starter help here:
GetColumnName_toArray.xaml (6.2 KB)

now i am getting the below error
![image|690x306](upload://67xMDfADmooPDqgV4ldNEEuipath error.docx (173.2 KB) cjuME.png)
As i am new to UIPath, pls help in this regard

the issue is not related to the provided code sample

there is a missmatch between Studio and Robot. As mentioned in the error message restart the machine and try again

Thanks Peter. it seems working. will check thoroughly and get back to you for clarifications, if any