Adding an In-Memory Row to a Data Source
You can add a temporary in-memory row to a data source at any time using the AddRowToDataSource function. When this function runs it will add a new row, which will only persist until the end of the current session.
This can be used to create the structure of an in-memory data source, but can be used to add temporary columns to a standard data source as well.
This function will not permanently save data to the data source. To do this, you should use the WriteData function instead.
Implementation:
- Open the Expression Editor where you want to add the expression.
- Enter the following:
AddRowToDataSource( DataSourceName, KeywordValues, ModelReference, DatabaseColumnNames );
- Replace DataSourceName with the name of the data source to use.
- Replace KeywordValues with a comma-separated list of keywords whose values should be saved to the new row.
- (Optional) Replace ModelReference with the reference for the model associated with the data source. This is only required if this function is called outside the context of a model, such as in a web page expression.
- (Optional) Replace DatabaseColumnNames with a comma-separated list of column names. This can be used to override the data source column order, and if this is used the first column listed here will be given the first value in KeywordValues and so on.
- Save the expression.