Step 4: Define filters

In the Filter definition tab, you can create advanced filters that users can directly access when creating complex queries, such as when defining an audience.

This step is not mandatory as you will still be able to populate your resource and access its data through workflows, audiences and REST API.

custom_resource_filter-definition

These filters are used in the query editor in the form of pre-configured rules. They allow you to limit the number of steps necessary to get the desired configuration, which can be particularly beneficial for repetitive segmentations.

For example, you can create a filter enabling to select all transactions greater than a certain amount within the last three months.

To do this, you need to extend the Profiles resource and define a filter linking to a transaction table (that you have previously created) with a rule indicating that the transaction price must be greater than or equal to a given parameter and that the transaction date must fall within a range corresponding to the last three months.

  1. Make sure you create and publish a transaction table. See Step 1: Define the resource.

    Not:

    This procedure uses the example of a custom transaction table. For your case, adjust it to your business needs.

  2. Before defining a filter related to the transaction table in the Profiles resource, make sure you define the link to this table and publish your changes. See Defining links with other resources and Step 5: Update the database structure.

  3. In the Definition tab of your new filter's definition screen, select the transaction table.

    custom_resource_filter-definition_example-empty
  4. In the Add a rule - Profiles/Transactions window, drag and drop the transaction table into the workspace. In the next window that is displayed, select the field that you want to use.

    custom_resource_filter-definition_example-field
  5. In the Optional parameter settings of the Add a rule - Transactions window, check the Switch to parameters box.

    In the Filter conditions, select the Greater than or equal to operator. In the Parameters field, enter a name and click the plus sign to create the new parameter.

    custom_resource_filter-definition_example-parameter
  6. Confirm your changes. This definition corresponds to a configurable field that the user must fill in later to execute the query.

    custom_resource_filter-definition_ex_edit-rule
  7. Combine this rule with another rule specifying that the transaction date must fall within a range corresponding to the last three months.

    custom_resource_filter-definition_example
  8. Choose the category in which your filter will be displayed.

    custom_resource_filter-definition_category
  9. In the Parameters tab of the filter definition screen, modify the description and the label to clearly indicate the subject of your filter to the users. This information will appear in the query editor.

    custom_resource_filter-definition_parameters

    If you define multiple configurable fields, you can modify the order in which they appear in the interface.

  10. Save your changes and publish the resources. For more on this, refer to the Step 5: Update the database structure section.

Once the Profiles resource extension is published, the users will see this filter under the shortcuts tab in the query editor interface.

This will allow the user to easily define their audience when creating an email to send to all of the clients that spent more than a certain amount over the last three months.

custom_resource_filter-definition_email-audience

Rather than configuring it themselves, they simply have to enter the desired amount in the dialog box that appears.

custom_resource_filter-definition_email-audience_filter

Bu çalışma Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License kapsamında lisanslanmıştır  Creative Commons şartları, Twitter™ ve Facebook sitelerinde paylaşılanları kapsamaz.

Yasal Uyarılar   |   Çevrimiçi Gizlilik İlkesi