I have a workflow set up, where it reads 4 excel sheets into different datatables, assigns them each a name with .TableName, and I have an array of these 4 datatable variables.
What I want to do, is to loop through every datatable, and invoke another workflow. In that workflow, I need to use the name of the current datatable, and that does not seem to work and I get an error that the referense is not set.
An example is below, where I try to call the TableName from the current datatable, and just put it into a message box, before moving on to the Workflow (the TypeArguement of āForLoopā is set as a datatable):
Not sure if I will have issues in the workflow as well. In the second workflow I have an āInā Argument set up, called ātableā like in the loop, and the values are set up in the āImport Argumentsā screen as well, with the argument value being ātableā.
What I ended up doing (for anyone else with a similar question), was initiate a new list with an assign activity like so:
DTlist = New List(Of System.Data.DataTable)
DTList, being a variable of System.Collections.Generic.list<System.Data.DataTable> type.
And then I used āAdd To Collectionā activity for each table, the collection being the DTlist, item is the name of the table and TypeArgument is DataTable.
There might be a faster way, but for my purposes it is quite reliable.