TruncateDataSource

Clears all in-memory data from an data source. Changes made with this function will only persist until the end of the current session and will not affect the underlying data.

To permanently clear rows from the data source, use the DeleteData function.

Syntax

TruncateDataSource( DataSourceName, ModelReference );

Parameters

Parameter Name Type Description Optional? Default Value
DataSourceName String The name of the data source to clear. No n/a
ModelReference String The model reference associated with the chosen data source. If the function is called by a model, it assumes the data source exists within that model, so you do not need to specify a reference unless the data source exists in a different model on the same repository. If the function is called outside the context of a model - for example, in a web page expression or via the DATASOURCE element tag - you must specify the model containing the data source. Yes ""

Output

If successful, the function will return an empty string; otherwise, it will return an error message.