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
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:
- Dynamics CRM Source Connection: SimpleToyCRM
- Source entity: SupportIncident which has an accountname field
- Target Connection: ToyMakerCRM
- Target entity: SupportCase which has an accountid field
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