set data set value
Description
Set the value of one or more cells of a column in a data set.
Arguments
data set
Name of the data set (see Notes).
row
(optional; see Notes)
Row number of the cell. (Row numbers start at 1, exclusive of any header row.)
column
Column number of the cell (Column numbers start at 1).
value
Value to which the cell contents are to be set.
criterion
(optional; see Notes)
Boolean expression establishing the filter criteria (see Notes), or a named filter as defined by the filter action.
Valid contexts
This action may be used within the following project items: test modules and user-defined actions.
Applicable Systems/Platforms
Use of this action is supported on the following systems/platforms: Windows, Linux.
Notes
The data set argument may specify a dedicated data set or inline data set that has already been defined within the test.
- for a dedicated data set: the full TA path from the Data node must be specified, with forward slashes (/) delimiting each level of the hierarchy.
- for an inline data set: only the name (no path) of the data set is necessary.
row and criterion arguments: Either, but not both, of these arguments is required. If both are supplied, criterion is ignored. Each of these arguments is responsible for selecting the row for the cell to be modified. (And in the case of criterion, multiple rows may be selected.)
When the filter is applied, those rows of the data set whose values do not produce a True when applied to the expression in criterion are filtered out. For example, if criterion is set to
region = 2 and period >= 2002
, the filter excludes those rows in which region is not 2, as well as those rows for which period is earlier than 2002.The following operators may be used within an expression in the criterion argument:
Table 1. Comparison operatorsPrecedence Comparison operator Meaning 4 = equal to 4 <> not equal to 4 > greater than 4 >= greater than or equal to 4 < less than 4 <= less than or equal to
Table 2. Logical operatorsPrecedence Logical operator Meaning 5 not Value is TRUE if its operand is FALSE. 6 and Value is TRUE if and only if both sides of the and operator are TRUE. 7 or Value is TRUE if either side of the or operator is TRUE. Notes:For the full list of operator precedence, see [here](/automation-guide/action-based-testing-language/the-test-language/operator-precedence).
If the value in row exceeds the current number of rows in the data set, empty rows are appended until the data set has row rows, after which the value in the designated cell is set.
If the data set is inline, all added data are stored in memory.
If the data set is a module, the data set is first checked out (if not yet in that state), and then modified. During the checkout process, TestArchitect issues a warning/error if either of the following conditions hold:
- the data set is currently checked out by another user; or
- the current user does not have sufficient permission to modify data sets.
Following execution of this action, it is highly recommended that you use a check in data set action to ensure that all changes to the data set are available before it is actually used.
This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.
Applicable Built-In Settings
The following settings are applicable to this action: remove double quotes from cells.
Example - Case 1: using the row argument
- Add a new value,
1 Smith Lane
, to the Address cell at row1
, column5
of the Customers dedicated data set. - Check in the dedicated data set.
Action Lines
Result
Effect
Example - Case 2: using the criterion argument
In the Customers data set:
- Update the CustFName (column #3) field of the record satisfying CustID=“04” to
Patti
. - Check in the dedicated data set.
Action Lines
Result
Effect