Data Record at Index
Last updated
Last updated
Data Record at Index
is an output block that provides an object representing the record at a specified index, after a successful read operation by the Data Read, Data Read Next Page and Data Read Previous Page blocks.
NOTE: This block will provide valid values only after the Data Read, Data Read Next Page and Data Read Previous Page blocks complete their execution. The Data Status block can be used to track the completion.
The block consists of the following (from top to bottom):
Table: Value Parameter that accepts a text value representing the name of the Database Table .
Dataset Name: Value Parameter that accepts a text value representing the name of the dataset on which a database read was conducted using the Data Read, Data Read Next Page and Data Read Previous Page blocks.
Index: Value Parameter that accepts a numeric integer values representing the index for which you want the data. The valid values are for the index are from 0 to Number_of_records_Read - 1. More on this topic below.
The index used to retrieve the data uses zero-based numbering. Hence the valid values start at 0 and end at 1 less than the total count.
e.g. If the number of records read was 10, then the valid values are from 0 through 9.
NOTE: Please refer to the prerequisite information shown here before seeing the example.
The image below shows an example of the Data Record at Index
block. This example incorporates the Usage Example function, as outlined in the Database Reading Logic for examples section on the prerequisite information page mentioned above.
To begin, the output of the Data Record Count block is assigned to the variable a
. Note that the Customers Database Table along with the dataset name of ds1 are used for the Value Parameters .
The If
block to confirm that the value of the variable a (number of records read) was at-least 1
.
The output of our Data Record at Index
block is assigned to the variable b
. Again note that the Customers Database Table along with the dataset name of ds1 and Index set to the value 0, are used for the Value Parameters .
The Show Information Popup block is used to display the values of the FirstName and LastName properties of variable b
.
The result for the above example is shown in the image below.