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:

  1. Open the Expression Editor where you want to add the expression.
  2. Enter the following:

AddRowToDataSource( DataSourceName, KeywordValues, ModelReference, DatabaseColumnNames );

  1. Replace DataSourceName with the name of the data source to use.
  2. Replace KeywordValues with a comma-separated list of keywords whose values should be saved to the new row.
  3. (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.
  4. (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.
  5. Save the expression.