Skip to main content

Combine attributes from different columns to create dynamic values

Combine attributes from different columns to create dynamic values in Productsup.

Introduction

You can create dynamic product information by using values from other columns. For example, you can create optimized titles containing a product's brand and color to show product variants.

Append or prepend the data from another column

Use the Append/Prepend Column rule box to add data to the end or at the beginning of your current input column from another column. The Append/Prepend Column rule box automatically adds whitespace before the data you append or prepend.

  1. Go to Data View and select the Intermediate stage or a certain export where you wish to add a rule box.

    • You can also select Intermediate or an export in Dataflow by selecting the small arrow that appears when you hover over an attribute in a column.

      Select the small arrow that appears when you hover over an attribute in either column.
  2. Select Edit for the column where you want to add a rule box. You can now see an open tab on the right-hand side.

  3. Select the Add Box drop-down menu to search for the Append/Prepend Column rule box.

  4. Select the column and choose either append or prepend in Mode.

  5. Optionally, you can add a static text before or after the attribute value.

  6. Select Save.

For example, the following setup appends the string EUR to the price column after a value:

append_column.png

Here is the output:

Current data 10.00 EUR

Create text templates using data from other attributes

If you want to insert values from several attributes into the text of the selected attribute, use the rule box Text Template that lets you add the values dynamically with the help of Twig. Twig is a template engine based on PHP that lets you add dynamic content in the template.

If you need to use in your text the values from the list created in the Lists feature, use the rule box Text Template with Lists .

See Enhance your product data with Twig for use cases and rule on how to create Twig codes.

Note

The Text Template rule box functions similarly to the Append/Prepend Column rule box but lets you link several attributes together using static placeholder text.

To add Text Template or Text Template with List:

  1. Go to Data View from the site's main menu.

  2. Choose the needed export channel or the intermediate stage in the drop-down menu on the left.

  3. Select Edit in the attribute column where you want to apply the rule box.

    Note

    Between the import and intermediate stages, you can only add an attribute from the import.

    Between the intermediate and export stages, you can only add an attribute from the intermediate.

  4. Select the Add Box drop-down menu.

  5. Search for and select the Text Template or Text Template with List rule box.

  6. Enter your text and placeholders to integrate attributes' values in your text.

    Tip

    Select the >_ icon in a rule box to get AI-based suggestions on Twig codes.

    Text Template
  7. If you add the rule box Text Template with List, you also need to select the needed list in the use list drop-down.

    Text Template with Lists
  8. Select Save.

For example, you need to create a description from your product_type and category attributes.

To dynamically add the value of the attributes into the description, enter the exact name of the attribute between two curly brackets and spaces at the beginning and end such as {{ attribute_name }}.

Attributes values

Text Template with Twig

Result

product_type: T-shirt

brand: Nike

This is a {{ product_type }} from {{ brand }}.

This is a T-shirt from Nike.

The rule box searches for the product_type and brand for each product and inserts their values instead of the text placeholders. The output dynamically changes and consists of your static text and the dynamic values for each item.

Tip

To create the most accurate prompts, see our best practices in Create the right prompt for the AI Twig generator.

Append or prepend the data from another attribute if it is not present

You can append or prepend another attribute if the value from the attribute is not already present. To perform this, use the Append/Prepend Column if Value Not Present rule box.

  1. Add the Append/Prepend Column if Value Not Present rule box.

  2. Select the column and choose either append or prepend in Mode.

  3. Optionally, you can add a static text before or after the attribute value.

  4. Select Save.

Append or prepend an attribute value to a specified character limit

With the Add Column if Fits rule box, you can specify the max length of your product attribute. It lets you only append or prepend an attribute value if it fits your specified length.

  1. Add the Add Column if Fits rule box and select the attribute you wish to append or prepend.

  2. Select the column and choose either append or prepend in Mode.

  3. In Max Length, specify a max character count.

  4. Optionally, you can add a static text before or after the attribute value.

  5. Select Save.