Method: Sources.FindValue( … )

Use for fast performance lookup of values from other Table Data Sources.
Returns the value from the specified data source, by key-value and column name.
This method is very similar to the Sources.Find() method. The main difference is that this method goes one step further, by directly returning a value if it exists.
Furthermore, this method does not fail if e.g. the requested column does not exist. This means, that in many cases you can lookup values from other sources with one line of script-code.
Returns the row from the specified data source with the specified key-value.

Syntax

DataRow Sources.FindValue( string sourceName, object keyValue, string column )

Method Parameters

string
sourceName

Name of the Data Source to search in.
The Data Source must be of the Table type with a unique key column as its first row, such as returned by the SELECT.UNIQUE Command.

object
keyValue

A keyValue to search for by the unique column in the Table data source.

object
column

Name of the Column containing the value.

Example

Below example shows how to lookup values fast in from a table of VEHICLES by using the input value as key, and returning a new value from a column named PerfionID in the table of VEHICLES.

// before call: Value="A-42" Value = Sources.FindValue( "VEHICLES", Value, "PerfionID" ); // after call: Value="456"