AddRowToDataSource
Adds an in-memory row to a data source. Rows created with this function will only persist until the end of the current session and are not saved to the original data source.
To write a new row to the data source, use the WriteData function.
Syntax
AddRowToDataSource( DataSourceName, KeywordValues, ModelReference, DatabaseColumnNames );
Parameters
Parameter Name | Type | Description | Optional? | Default Value |
---|---|---|---|---|
DataSourceName | String | The name of the data source to which the row should be added. | No | n/a |
KeywordValues | String | A comma-separated list of keywords whose values should be added. These must be listed in the matching data source field order. | 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 | "" |
DatabaseColumnNames | String | A comma-separated list of column names, which can be used to override the data source field order. If used, the first column listed here will be given the first value listed in KeywordValues, and so on. | Yes | "" |
Output
If successful, the function will return an empty string; otherwise, it will return an error message.