Skip to main content

Map an Element to Different Data Using Conditional Properties

Updated this week

Conditional Properties in Cropink allow you to change the data source of a single element dynamically, depending on conditions you define.
This is useful when you want the same layer (such as a badge, a text field, or a label) to display different values for different product scenarios.

For example:

  • If a product is discounted, show the discount percentage.

  • If a product is not discounted, show a custom label instead.

With Conditional Properties, you can switch the data mapping of one element without duplicating layers or creating multiple designs.

Step 1: Map the element to the default parameter

In Cropink:

  1. Open your project and select the design.

  2. Click Edit in Design Manager → open Manageable Layers.

  3. Select the layer (e.g. badge layer).

  4. Choose Data Mapping.

  5. Set the default mapping, e.g.:

    discount_percentage

This becomes the primary data source of the badge.

Step 2: Add a Conditional Property to remap the element

Now we add a rule that replaces the badge’s data source when the product does not meet the discount condition.

  1. Next to the same layer, click the + icon again.

  2. Select Conditional Properties.

  3. Create a rule that detects when a product is not discounted.
    For example:

if sale_price is empty then map to custom_label_0

This tells Cropink:

  • If sale_price exists → use the default mapping (discount_percentage)

  • If sale_price is empty → switch mapping to custom_label_0

Step 3: Add fallback visibility logic (optional but recommended)

To avoid showing empty content:

  1. Add another rule under Conditional Settings:

    if custom_label_0 is empty then Hide

This ensures the badge only appears when the alternative label is available.

Step 4: Save and preview

Click Save Changes and preview your design.
The badge will now display different data depending on the product:

Examples:

  • Product on sale → Shows “-25%” (discount_percentage)

  • Product not on sale → Shows any value that is included in custom_label_0

💡 Tip: You can add multiple Conditional Properties to switch between more than two data sources:

  • For “bestseller” label

  • For “eco-friendly” tag

  • For “limited edition”

  • For category-specific badges

Your element becomes fully dynamic based on your feed.

That’s it!
You’ve successfully used Conditional Properties to remap a layer to different data sources — allowing one element to behave intelligently based on real product data, without duplicating designs or layers.

Did this answer your question?