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
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:
- Dynamics CRM Source Connection: SimpleToyCRM
- Source entity: supportincident which has firstname and lastname fields
- Target Connection: ToyMakerCRM
- Target entity: SupportCase which has an accountid field
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