Need to get table name from a datatable variable

Hello ,

I have a list of DataTables. For each one, I want to get the DataTable name.
The screenshot below can help to understand:

In above screenshot, item.TableName gives value - “TableName”. Not the actual tablename value.
Can anyone please help me on this?


If your DataTables actually have a TableName, item.TableName should return the TableName.

How did you set the TableName of your DataTables?

I have declared 2 datatable variables like below.

I am Assigning values to these datatables from another datatables.
These two table have values . I checked that.

if a tablename was set to the table on YourTableVar.TableName then it can be used.
But this tablename has actively to be set eg by

  • new DataTable(“YourTableName”)
  • YourTableVar.TableName

the fasted way to check the current is situation is to check the tablename within locals / watch / immediate panel during a debugging paused by a breakpoint

1 Like

new DataTable(“YourTableName”) - This needs to be provided at the time of declaration like below?

you will decide when to do, directly on initialization or later via: YourDataTableVar.TableName
but the tablename is to set actively otherwise we do see a default name or null

Adding ‘new DataTable(“YourTableName”)’ in variable panel is not working for me.
Assign tablename using assign activity works for me. (YourDataTableVar.TableName = “TableName”)


both options are working