LOOKUPTARGETVALUE

Syntax

LOOKUPTARGETVALUE (entity, lookupfield, field_value, returnfield)

Description

Uses a field name and value in a target entity to find the corresponding value of another field in the same entity.

Arguments

entity The name of the entity in the target data source to search.
lookupfield The field in the target entity to use as the look up.
field_value The value of the lookup field.
returnfield The field that will contain the value you want returned from the record where the field_value matches the value in the lookupfield.

Returns

The value of returnfield in the record where the field_value matches the value in the 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_value may be a constant string, but is usually a source field.

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 and name 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 LOOKUPTARGETVALUE, which retrieves the corresponding account entity by matching account.name in the target data with supportincident.accountname 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:

LOOKUPTARGETVALUE ("account", "name", supportincident.accountname, "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