Get Records for Entity

To set up a query and define a segment, for each level, select the entity and set all the conditions that will be applied on the selected entity.

In the entity section, you can add all entities involved in the query. Entities start with the main entity and continue with related entities, one for each level. Usually, the first entity is the Customer entity, but can be any entity from the data model.

NOTE  
  • When defining a segment, the first entity selected to define conditions and tokens becomes the context entity of that segment.
  • Only one related entity can be linked to a parent entity. You cannot add several related entities to the same parent entity. For example, if you select the Customer entity as your context entity, you can only add conditions for “Loan Applications” or for “Loan Agreements”, not for both in the same segment.

We recommend users to create two segments using the following route:

Customer

→ Loan Application

Customer

→ Loan Agreements

Correct use cases:

  • You can link Customer -> Contract -> Installments. That means three deep levels, one entity on each level (customer on the first, contract linked by customer on the second and installment linked by contract on the third).
  • You cannot link Customer -> Contract, Financial Assessment because both Contract and Financial Assessment are linked by the same entity, Contract.

You can set complex conditions using simple or nested group conditions. The figure below shows the Customer entity filtered by age between 18 and 74 and acceptance for marketing equal true.
You can set up a complex filter by clicking the plus (+) sign and Add Group 

A new nested group will be added to the filter condition you can add a new expression similar to: ((a>=10 or b=’condition’) and c=true).

The table below provides all the settings you can do in the entity section:

Setting Description
Get all records for entity Select the main entity that will be the first level of query. On the second level of query, you can insert only one related entity.
Use following filters on data Add filters on the selected entity. You can add a condition by clicking the plus sign and selecting Add Condition.
A new condition will be inserted. 
Condition sign The AND condition is displayed by default; however, you can select another condition: OR, NOT AND and NOT OR.
Delete a condition  Click the X sign to delete an inserted condition.
Condition attribute The next field represents one of the entity’s attributes. You can select it by clicking on the field and opening a list with all the attributes. The date type attributes are marked with an arrow and you can select one of these functions:
  • Days since – the count of the days which have past from the date until now.
  • Months since – the count of the months which have past from the date until now.
  • Years since – the count of the years past from the date until now.
  • Year of – the year of the date.
  • Month of – the month of the date.
  • Date of – returns only the date part (without time) from the date.
  • Weekday of – the weekday number of the date.
  • Has anniversary today – returns true if today has the same day and month as the date.
  • Days until – the count of the days from today until the future date
  • Months until – the count of the months from today until a future date
  • Years until – the count of the years from today until a future date.
  • Day Of – the day of the date.
  • Days until Anniversary – the count of the days from today until the date.
  • For “since” functions, if the date is a future date, then the return count will be negative.
  • For “until” functions, if the date is a past date, then the return count will be negative.
Condition operator Select the conditional operator by clicking on the label and selecting the desired one from the list.
For the date type attributes there are two more operators: @Equals and @Does not equal, that compare the date with some predefined parameters such as current_year, current_month, current_day, current_weekday. The values for these parameters are evaluated at runtime.
Condition value The last part of a condition is represented by value. There are different types of values for each type of attribute and operator. You can add a simple text or number, an interval of numbers, values from other entity for lookup attribute type, option set items and values based on current date as those above.
Group condition Add a group condition by clicking the plus sign  and selecting Add Group .
You can also add multiple levels of groups (nested groups).
Make following data available for tokens Select attributes from the selected entity and use them as tokens in digital content templates to tailor the communication with targeted customers. An attribute can be searched typing the first letters or browsing it in the list.
Add Entity Add a related entity to current query.
Links related to entity The list is populated with entities related to the main entity and gives you the possibility to choose only one. If more than one related is needed for the same entity, you should create another segment.