Skip to main content

Apply rule boxes based on conditions

Learn how to apply rule boxes to your data based on whether certain attributes in your Productsup site meet the needed conditions.

Introduction

Rule Box Conditions is a feature in Dataflow that lets you create and set up conditions to determine the cases when the platform should apply rule boxes to an attribute.

A condition consists of two (2) elements:

  • Condition statements.

    The Rule Box Conditions page with the condition statements panel highlighted in red
  • Rule boxes.

    The Rule Box Conditions pages with the rule boxes section highlighted in red

If the configured condition statements are true, the platform applies a set of rule boxes to your data. Optionally, you can choose which rule boxes the platform should apply to your data if the configured condition statements are false.

Note

You can't yet use the Rule Box Conditions feature with Shared Dataflow capabilities. We are working to change that.

Rule box conditions use case

Here is an example of how the Rule Box Conditions feature works.

If you want your title attribute to feature the name of the brand only if it is a luxury brand, you can create a condition in Rule Box Conditions in Dataflow and then apply it to the title attribute.

To implement this logic, the condition you create uses its condition statements to check whether the brand attribute contains such values as Gucci, Prada, or Balenciaga. If it does, the platform applies the Append/Prepend Column rule box to the title attribute and adds the name of the brand at the beginning of the attribute's value.

A condition for featuring a brand name in an attribute

Difference between segments and rule box conditions

Both the rule box conditions in Dataflow and the segments in Data View serve the same purpose. These features let you apply rule boxes to an attribute if another attribute contains a certain value.

Segments provide bare-bones functionality where you can add one condition per segment, while the Rule Box Conditions feature is more versatile. It offers a more visual interface and lets you set up more elaborate logic.

See Apply rule boxes to product segments for more information on segments.

Create a rule box condition

  1. Go to Dataflow from your site's main menu.

  2. Select Rule box conditions in the top ribbon.

    Rule box conditions button that you can find in the top ribbon of Dataflow
  3. Choose where you want to create a condition in Stage:

    1. To apply a condition to an attribute at the intermediate stage, select Intermediate.

    2. To apply a condition to an attribute at the export stage, select Export.

  4. Select Add a condition, give it a name and description as desired, and select Create.

    Once finished, you can see and change the name and description of your condition in the General section.

  5. To start setting up your condition, select Add a condition statement.

    To start setting up your condition, select Add a condition statement
  6. Set up the added IF condition statement:

    if_condition.png
    1. In the attribute drop-down list, choose an attribute that the platform should scan for the needed values. By default, the platform preselects the first attribute in alphabetical order from the stage chosen in Step 3.

    2. In the contains drop-down list, select the requirement that the platform should apply to the values of the attribute selected in Step 6.a.

    3. Enter the value that the platform should search for, or select the toggle Use an attribute to let the platform search the attribute chosen in Step 6.a for the values of another attribute.

  7. If you want a more elaborate set of condition statements, you can select the plus icon () to add more condition statements and set them up as described in Step 6.

    IF and AND condition statements can have multiple OR condition statements.

    IF and AND condition statements can have multiple OR condition statements.
    1. Choose AND to let the platform apply rule boxes if both IF and AND condition statements are true.

    2. Choose OR to add more options to the existing IF or AND condition statements.

  8. When your condition statements are ready, select Save changes.

  9. In the Action tab of the rule boxes menu on the right, choose Select an Option to add and set up the rule boxes you want the platform to apply to your data if your conditions statements are true.

    See Optimize your product data with rule boxes to find a document about the needed rule box type.

  10. Select the green Save button in the Action tab when you finish setting up these rule boxes.

  11. Optionally, you can open the Else tab of the rule boxes menu and choose Select an Option to add and set up the rule boxes you want the platform to apply to your data if your condition statements aren't true.

    Select the green Save button in the Else tab when you finish setting up these rule boxes.

  12. See Apply a rule box condition to an attribute to proceed.

Apply a rule box condition to an attribute

To let a condition apply the needed rule boxes to your data, you should add it to a desired attribute in Dataflow.

  1. Go back to the main Dataflow page by selecting Dataflow in one of these locations:

    1. In your site's main menu.

    2. In the breadcrumbs section at the top of the page.

      Go back to the main Dataflow page by selecting Dataflow in breadcrumbs
  2. In a relevant stage, select the attribute where you want to apply a rule box condition.

    Note

    The attribute you choose must be in the same stage where you created the needed condition. See Step 3 of creating a condition.

  3. In the Edit panel on the right, choose Select an Option.

  4. In the Conditions section, select your desired condition and choose Save.

    add_a_condition_to_an_attribute.png
  5. If the attribute where you added a condition has other conditions or rule boxes, you can drag and drop the new condition to a desired place. This way, you can arrange the order of data optimizations in this attribute.

    If you want to check the settings of an added condition, select Go to condition.

    conditions_and_rule_boxes_order.png

You added a condition to a desired attribute. The number of bubbles you see on the connection of this attribute with a previous stage corresponds to the number of rule boxes and conditions added to this attribute.

Edit a rule box condition

If you want to change the settings of a rule box condition, you can edit it:

  1. Go to Dataflow from your site's main menu.

  2. Select Rule box conditions in the top ribbon.

    Rule box conditions button that you can find in the top ribbon of Dataflow
  3. In Stage, choose the stage where you want to change a condition.

  4. Change the desired settings of a condition by adding, editing, or removing condition statements.

    To remove a condition statement, select the trash icon next to it and then select Delete.

    When finished with the condition statement changes, select Save changes.

  5. Change the desired rule box settings by adding, editing, or removing rule boxes.

    To remove a rule box, select the wrench icon and then select the trash icon.

    When finished with the rule box changes, select the green Save button.

    Tip

    You need to select Save in each tab of the rule boxes menu where you make changes.

Delete a rule box condition

If you no longer need a rule box condition, you can delete it:

  1. Go to Dataflow from your site's main menu.

  2. Select Rule box conditions in the top ribbon.

    Rule box conditions button that you can find in the top ribbon of Dataflow
  3. In Stage, choose the stage where you want to delete a condition.

  4. Select the trash icon next to the condition you want to delete and confirm the action by choosing Delete.

    Note

    If any attribute in your site uses this condition, this action removes the deleted condition from that attribute. It means that the site stops applying the related data optimizations to this attribute, which may affect your export data.