GetValue Method

Relevant for: API testing only

Description

Retrieves a specified value from the selected data source.

Note: This method is a method of the data source. In order to use this method to get a data source value, you must retrieve a data source using the GetDataSource method

Class

DataSource

Syntax

GetDataSource(<data source name>).GetValue(<row index>, "<column name>");

Parameters

Parameter Description
Row index

Required. The row from which to take the value.

The row index is zero-based, meaning if you want to pull from the first row of the table, you must set the row index value to 0.

Column name Required. The name of the column from which to take the value.

Return Type

Data value (format depends based on the data source type)

Example

var TableDataSourceValue = GetDataSource("WebService Customer Table").GetValue(0, "CustomerName");
var GetFlights_Input_Departure_City = GetDataSource("WebServiceData!Input").GetValue(this.Loop2.CurrentIterationNumber-1, "DepartureCity").ToString();
StServiceCallActivity4.InputEnvelope.SelectSingleNode("/*[local-name(.)='Envelope'][1]/*[local-name(.)='Body'][1]/*[local-name(.)='GetFlights'][1]/*[local-name(.)='DepartureCity'][1]").InnerText = GetFlights_Input_Departure_City;