Lookup Block
Use a Lookup block to retrieve data from selected fields within an Entity according to lookup criteria that you specify. This block retrieves data to use in a formula or to populate a field in another entity that may not be in your initial query. See Lookup Block Example for a detailed use case scenario.
Block Properties — General Tab
From the Block Properties General Tab, you can change the Block Label, add a description, enable caching, and select the entity to use for this operation.
Caching
Improve the performance of the flow by enabling the caching option labeled, Cache the results of this operation. When enabled, Lookup results are cached by the agent until the end of the flow making the data available for reuse without having to retrieve it again.
Data is cached as it is looked up instead of caching all of the data in the entity being searched. For example, if you are running a query that has to do with currency, when the flow needs to know the value of a specific currency, such as US Dollars, the Lookup operation requests the value of that single currency and caches it. When the flow needs to know the value of Euros, the Lookup operation requests the value and caches it along with the value of US Dollars. The cache grows as each new piece of information is added. When a request is repeated, such as asking for US Dollars a second time, the cached data is used.
If data changes during the time the flow is run, the cached data is used and the changes are not taken into account. If you know that the values of the data retrieved by the Lookup block may change during the execution of the TIBCO Scribe® Online, you may not want to enable caching. The default setting for this option is disabled.
Block Properties — Lookup Criteria Tab
Use the Lookup Criteria tab to specify one or more criteria used to find the record in the target that corresponds to the current source record.
- On the Lookup Criteria tab, select Add. A lookup criterion row displays.
- Select the blank cell under Field to display a drop-down list of the fields in the entity that can be used for the lookup. Select the field to lookup from the drop-down list.
- Under Operator, select an operation, such as equals.
- Under Value, enter a value for the match for the lookup. TIBCO Cloud™ Integration - Connect uses this value to match records between the source Entity and the Entity specified for this block.
On the Value field select the Formula icon to open the formula editor to include a formula, another field, or a previously specified operation. See Formula Editor Overview.
- If needed, select Add again to create an additional lookup criterion.
After you select Add a second time, the And/Or column displays. Select and or or from the drop-down list to determine how to combine lookup criteria. When the flow runs, the criteria is evaluated in order from top to bottom.
- To delete a row, select the row and from the Gear menu select Delete.
- When you are done, continue defining this block or select OK to close the Properties dialog and return to the workspace.
Lookup Criteria Examples
In the examples shown below TIBCO Cloud™ Integration - Connect looks up Contacts that meet the selected criteria for use later in the flow.
Example 1
And/Or |
Field |
Operator |
Value |
---|---|---|---|
|
CompanyName |
equals |
Customers.CompanyName |
and |
Active |
equals |
TRUE |
or |
ContactName |
equals |
Customers.ContactName |
These settings are interpreted by TIBCO Cloud™ Integration - Connect as follows:
((CompanyName=CompanyName AND Active=TRUE) OR ContactName=ContactName)
To include the Contact in the lookup, one of the following must be true:
- CompanyName field must be the same AND Active must be set to TRUE.
- ContactName field must same.
Example 2
And/Or |
Field |
Operator |
Value |
---|---|---|---|
|
ContactName |
equals |
Customers.ContactName |
or |
Active |
equals |
TRUE |
and |
CompanyName |
equals |
Customers.CompanyName |
These settings are interpreted by TIBCO Cloud™ Integration - Connect as follows:
((ContactName = ContactName OR Active=TRUE) AND CompanyName = CompanyName)
To include the Contact in the lookup, both of the following must be true:
- ContactName field is the same or Active is true.
- CompanyName field is the same.
Block Properties — Field List Tab
Use the Field List tab to specify the fields you want returned for every record that meets the lookup criteria. The fields you specify are available to use in formulas in subsequent Blocks. Select only the fields you need to reduce the time needed to return the data to the flow.
Selecting Fields
From the Field List tab, select the checkbox for each field you want to return. The following rules apply:
- To select all fields, use the Select link above the checkboxes. If you want to select most fields, use the Select link and then clear the checkboxes for the fields you do not want to include.
- To clear your selections, use the Deselect link above the checkboxes.
- You can filter on Field name, Data Type, or Description. Select the Filter icon () to edit the Filter dialog, as described in Using The UI Filters.Note: The Select link selects every field including those that are not displayed when a filter is used.
Block Properties — Error Handling Tab
Use the Error Handling options to enable or disable processing this record when a Block operation encounters a problem.
For the Lookup block, errors can be logged as follows:
- When an operation fails — If the Lookup operation fails, an error is logged.
- If no matches are found — If the record being processed does not match any target records based on the information in the Lookup Criteria tab, an error is logged.
- If one or more matches are found — If the record being processed matches one or more target records, an error is logged.
- If more than one match is found — If the record being processed matches more than one target record, an error is logged.
See Block Properties Error Handling Tab for additional information.
Block Properties — Errors And Warnings Tab
If there are any errors or warnings for this block, the Errors and Warnings tab displays the number of errors or warnings in the tab name. See Block And Flow Errors And Warnings.
Once you have corrected the errors, select the Validate button to update the Errors and Warnings tab.