Hi,
See the attached model and data.csv files. The model assumes that the data.csv files are in the same directory as the model. In the model file I have a global table and using the script window I call importtable to import the data from the .csv file and then try to clear the global table. It never seems to clear the whole table as it should. I tried to call clearglobaltable both with the table name as reference and reftable(tablename) as reference.
When I call clearglobaltable using the table name as reference it seems that cells in the first column are cleared up to the row amount that was previously used in the table. When I was looking at this it first only cleared the first cell of the table, but then when I imported the data2.csv file and then data1.csv again it seemed to clear the first four rows, which could indicate that the table remembers the size before importtables and uses that when clearing the table.
When I tried to call clearglobaltable using reftable(tablename) as reference it seems that all cells in the first column of the table are cleared, but not the whole table.
Importing the column headers seems to affect if the first row is cleared or not in some way.
Is this a bug with importtable or clearglobaltable?
Also, as another note. If I have the global table view open when I run the script then the Rows field in the Quick properties window does not update visibly (from 4 to 5 in this case when changing the data file to import). However, if I close the table view and reopen it, then the row amount has updated to the correct size of the imported table. I guess this is just that the quick properties window is not updated when the table view is open.
20161021-clearglobaltablenotworkingwithimportgloba.zip
Thank you!
Kind regards,
Axel