Lookup component

The Lookup Component performs a search in an Audience List or any other list based on a condition.  The result of the lookup can be sorted using a field in the selected list.

For example, in a Registration journey, you want to check if a contact who is registering already exists or not. You can check whether the email address entered in the form exists in the lookup list. If it does, the contact will get a message that a registration already exists. If not, the contact can be created in the database with the Data Component and will receive a message that they are now registered.

The Lookup Component can contain a constraint that uses fields from the Audience List as well as any other list to filter the records returned. This constraint can use the posted value of a form (input field) or fixed values (such as MAIL='someone@somedomain.com'). A Constraint Builder is available to simplify the creation of this condition.

Records can be sorted ascending or descending by using a field in the selected lookup list. This will return the first record that answers the condition.

Properties

1. Start by entering a name and description for this Lookup Component.

2. Next, select the list to perform a lookup in. This can be any list that is currently available for the current selected organization.

Note: All lists are preceded by an icon giving information on the type of list. The main Audience List for the Custom Journey is displayed in bold.

3. Click the Edit filter button to access the Constraint Builder.


You have access to all the fields in the selected list and linked lists. You can use a string value, or a posted value (coming from a form field), or do a value to value comparison on list fields, to create the condition.

  • For a string value, select 'Value' and enter the desired value.

  • For a posted value, select 'requestValue' and enter the desired posted value.

  • For a value to value comparison to fields in the Lookup or Extended List , select 'Listvalue'.
    You can choose to compare the field value in the selected Lookup List field with another field from the same list, or one of its 1:1 or N:1 profile extensions.

    When this option is selected, a drop-down with all list scopes is shown (the Lookup list and all of its 1:1/N:1 profile extensions).
    After selecting the scope , another drop-down allows selecting a field for that scope.

    Example: Parana Orders is the Lookup List from which we want to retrieve only those records where the ORDER ID is in the 1:1 Linked list 'HIGHESTORDERSCOPE'. A value in the Lookup List is compared to a value in a 1:1 Linked List.

  • For a value to value comparison to a field in the main Audience List or Linked List, select ProfileValue
    You can choose to compare the value in the selected Lookup List field with a field value in the Main Audience List or a field value in a 1:1 extended profile of the Audience List.

    Example: Perform a lookup in the Vouchers list, to check if there is a voucher that corresponds to the preferences of the contact and that hasn’t been used or allocated yet. The Preferences of the contact are stored in the list PREFERENCES, 1:1 linked to the Audience List.



4. Next, you can toggle between different options:

Switch profile — When checking Switch to profile the journey continues with the found contact profile in the Audience List (when the condition evaluates as true).

This can be used to switch from an anonymous contact to an known contact. So when a contact is found all further actions in the journey will use the contact's profile. In the Registration example, the person fills in the registration form as an anonymous contact, after he is found with the Lookup Component he is a known contact, the journey continues, using that profile data.

Check if exists — When selecting this option, a check is made if a record exists that complies with the given constraint.

Note: These options are only available for a lookup in the Audience List.

Load data — When selecting this option, the data is loaded and can be used for personalization in messages (pages only) and in all journey components following the Data Lookup, such as a Data Component, Split Component and the Validation Component.

Note: The loaded data cannot be used for personalization in emails or mobile messages.

A specific expression is available to use this data: [%journeyLookupValue('LIST_API_Name', 'FIELDNAME', 'MY_SCOPE')%]

Example: In the Split Component, the look up data can be used to define the different paths after the split. Here the Category data from the PARANAORDERS lookup list is used to split on the 'Home' and 'Sport' Values


In the Validation Component, the expression can be used to test for a specific value and return an error if not found:
eq(journeyLookupValue('PARANAORDERS','CATEGORY'), 'Home')

5. In the Advanced section you can sort the result using fields in the list and sort it ascending or descending. (For example, use a date field and sort with the most recent ones at the top).
In addition, a scope can be defined. This scope can be used on the above expression to load the data from a specific Lookup Component.

Example: A Custom Journey contains 2 Lookup Components.
One component does a lookup in the orders and filters on the most recent order. The other component does a lookup in the same orders but with a filter on the first order. Each of these lookups have a scope: RecentOrder and FirstOrder.
When using the lookup data in a message (pages only), the scope is specified
[%journeyLookupValue('Orders', 'Amount', 'RecentOrder')%] => returns the amount of the last order
[%journeyLookupValue('Orders', 'Amount', 'FirstOrder')%] => returns the amount for the first order

6. When the selected lookup list is linked to the Audience List, an additional option is available to choose if all records in the lookup list are returned or only the ones for the current contact in the audience.

In case multiple relations are found for the selected lookup list, a drop-down field allows selecting the right relation. The scope for the related Audience List is automatically selected when only one relation exists for the selected lookup lists.

7. Click Close to finish.

Note: If several records are found for the lookup definition, the first corresponding record will be returned (SELECT TOP 1 ID FROM...).

 

Events

The Lookup Component produces two types of events:

  • On Found — The lookup has a match and returns the first record it finds.
  • On Not Found — The lookup has no match.