Formula Editor
The Formula Editor is a no-code interface that enables users to interact with data, define conditions for attributes, and create labels and segments. This guide provides step-by-step instructions for navigating the editor, creating rules, and managing conditions effectively. It is designed for users seeking to optimize data workflows without any technical expertise.
Table of Contents
- Understanding and Managing Formula Types
- Accessing the Formula Editor
- Using the Formula Editor
- Viewing Results
- Quick Answers to Common Issues
- Related Articles
Understanding and Managing Formula Types:
Each attribute in your mapping can use a different type of formula. Here's how to identify and work with them:
- SQL Formula: Attributes with SQL-based formulas, such as the Brand attribute in our example.
- Formula Editor: Attributes with no-code, visual formulas, like the Title attribute, can be created by combining fields. For instance, you might concatenate Product_Name and Model_Number to generate a title.
- Empty Attributes: Attributes without formulas, such as the Description attribute, can be populated by adding a new formula. For example, you could merge the Features and Specifications columns to create detailed descriptions.
For more details, explore the article on Mapping.
Accessing the Formulas Editor
Our no-code Formula Editor is accessible via the Mapping screen:
- Navigate to the Mapping screen.
- By default, the Formula Editor is enabled. If you prefer, you can switch to the SQL Editor or advanced customizations.
- To add or edit a formula : Click the "+" sign next to the attribute you wish to configure.
Using the Formula Editor
Creating a Rule
Follow these steps to create a rule:
- Name the Rule: Provide a meaningful name for the rule (e.g., "Electronics Category Labeling").
- Select the Data (When): Choose the data from your source to apply conditions. This can include variables created with the SQL editor.
- Choose the Condition:
- For presence or absence: Use conditions from the State section (e.g., "Is Not Empty" to check if a column has data).
- For text values: Use conditions from the Text section (e.g., "Contains" to search for specific keywords).
- For numeric values: Use conditions from the Numeric section (e.g., "Greater Than" for price thresholds).
- For date ranges: Use
internal.current_date
to create rules for time-sensitive promotions (e.g., "Activate 10% discount for products in the Electronics category during the week leading up to a major sales event, starting seven days before and ending on the event day").
- Define the Result: Specify what the rule should output (e.g., data selection, variable transformation, text concatenation). For more details, refer to the Types of Actions section.
Adding Conditions
To refine rules, add multiple conditions with logical operators:
- AND: Selects products meeting all conditions (A + B).
- OR: Selects products meeting any one of the conditions.
Combining Conditions
It's possible to create a rule succession with several conditions for an attribute. Important, there is an order of priority in the execution of the rules, it's executed according to the established order. Consequently, a rule that targets few products must be placed in the first position, while a rule that targets a large part of the catalog must be placed in the last position.
If you want to target products:
- In the "Electronics" category (Condition 1: Category = Electronics)
- With a price over $500 (Condition 2: Price > 500)
Use the AND operator to include both conditions.
Types of Actions
Actions allow you to transform data. Available options include:
- Capitalize the first letter (e.g., "laptop" becomes "Laptop").
- Convert all letters to uppercase (e.g., "Laptop" becomes "LAPTOP").
- Convert all letters to lowercase (e.g., "Laptop" becomes "laptop").
- Remove HTML code (must be the first action in the sequence).
- Eliminate double spaces.
- Limit character count (e.g., restrict descriptions to 150 characters).
- Replace a value with another (e.g., replace "Smartphone" with "Mobile Phone").
- Clear the value (make it null).
Concatenating Values
You can combine multiple values, attributes, and alphanumeric text. To add a field, fill it out and press Enter.
Managing Rules
- Visualize the portion of products covered by each rule.
- View product distribution across rules.
- Reorder rules for proper priority using drag-and-drop.
Understanding Rule Exclusivity: It's essential to understand that rules are applied exclusively. Once a product meets the conditions defined in a rule, it is processed by that rule and will not be evaluated against subsequent rules for the same attribute. This exclusivity highlights the critical importance of the rule order you establish (placing more specific rules first) and means you generally don't need to repeat the same conditions across lower-priority rules. - Activate/Deactivate Rules: Control whether a rule is applied using the toggle switch next to it.
- A rule is Active when the toggle is switched On (Indicated by a green color). Active rules are processed in order and will affect your product data.
- A rule is Inactive when the toggle is switched Off (Indicated by a gray color). Inactive rules are saved but skipped during processing, allowing you to keep them for future use without deleting them. Ensure a rule's toggle is Active if you want it to run. - To the right of the visualization, you’ll find a menu represented by three vertically aligned dots (⋮) offering the following options:
- Delete a rule (Note: Once deleted, the rule must be rewritten from scratch.)
- Duplicate the rule (within the same attribute).
- Copy the rule to another attribute within this product flow.
Tips: Don’t forget to save your changes using the button in the bottom-right corner.
Viewing Results
After configuring your rules, click the See Results button to explore the outcomes. For instance, products labeled "High-End Electronics" should now appear under this segmentation.
Quick Answers to Common Issues
Why isn’t my rule applying?
Ensure the rule order prioritizes specific conditions first.
Verify that the data source includes the attribute used in the condition.
How do I handle missing data in attributes?
Use the State section conditions to manage presence/absence effectively.
Can I apply a rule I created to another custom attribute with a different source?
Yes, you can copy a rule from one attribute to another custom attribute and adjust it by changing the source to match the new context.
Related Articles
For further assistance with SmartFeeds, consider reviewing these articles:
For additional help, feel free to reach out via our Contact Us page.