LOOKUPTARGETVALUE2

Syntax

LOOKUPTARGETVALUE2 (entity, lookupfield1, field_value1, lookupfield2, field_value2, returnfield)

Description

Uses two field names and values, such as City, State, in a target entity to find a corresponding value of another field in the same entity, such as SalesRegion.

Arguments

entity The name of the entity in the target data source to search.
lookupfield1 The first field in the target entity to use as the look up.
field_value1 The value of the first lookup field.
lookupfield2 The second field in the target entity to use as the look up.
field_value2 The value of the second lookup field.
returnfield The field that will contain the value you want returned from the record where the field_value1 and field_value2 match the values in the corresponding lookupfield.

Returns

The value of returnfield in the record where the field_value1 and field_value2 match the values in the corresponding lookupfield.

Remarks

Note: For Integration flows with multiple target Connections, LOOKUPTARGETVALUE and LOOKUPTARGETVALUE2 generate an error. While you can use these functions for flows with a single target Connection, best practice is to use the Lookup Block to look up data on multiple target datastores.

The field_values may be constant strings, but will usually be source fields.

Examples

Assume the following data is mapped in a TIBCO Cloud™ Integration - Connect On schedule app:

The ToyMakerCRM Connection also contains an account entity with id, firstname, and lastname fields. In addition, the supportcase.accountid field represents a foreign key relationship to account.id.

Use the flow to populate supportcase.accountid with the corresponding value of account.id. To do so, use LOOKUPTARGETVALUE2, which retrieves the corresponding account entity by matching account.firstname and account.lastname in the target data with supportincident.firstname and supportincident.lastname from the source data, and then provides the necessary account.id value.

If a record in the account entity id field has the value of 123, then:

LOOKUPTARGETVALUE2 ("account", "firstname", supportincident.firstname, "lastname", supportincident.lastname, "accountid")

Returns: 123

Note: Unfortunately, in many real world scenarios there is not a convenient field in the source data, such as supportincident.accountname in the previous example. In this case, consider adding a custom field to the target data and populating it with a copy of the field you need from the source.

Related Topics

Lookup Functions