Conditional Mapping in Dynamic Video Templates

Updated 

Conditional Mapping lets you control the visibility of video elements using predefined rules or custom scripts. When you apply a Dynamic Video Template (DVT) to Catalogs or Automated Feeds, you can add conditions to video layers such as text, shapes, banners, overlays, and logos, to dynamically show or hide them based on feed data.

To Apply Conditional Mapping in a DVT

  1. Open a new tab in Sprinklr and go to Sprinklr Marketing > Advertising > Feed Creation.

  2. On the Automated Feeds screen, find the feed where you want to apply a DVT and click the Apply Template icon.

  3. Click +Dynamic Template in the top-right corner.

  4. In the Media Uploader pop-up, open the Video Template tab.

  5. Select the required DVT and click Apply to Entire Feed.

  6. In the DVT Editor, click +Conditional Mapping within the respective dynamic text, image or video sections to set the conditional visibility rules.

  7. Choose the condition type from -

    • Rule-Based Conditions - In this, you can set the conditions based on your requirement. You can add more conditions to your product by clicking the + icon next to the condition.

    • Script-Based Conditions - You can set complex conditions using this option.

      Example:discount = (( {{ price }} - {{ sale_price }} ) / {{ price }}) * 100; ​       if (discount > 20) return "yes";​       else return "no";

      In the above condition, price and sale_price are columns from the Feed file. Additionally, the return statement Yes signifies that when the Discount is greater than 20, the element will be visible, otherwise, it will not be visible.

      Once you have set your conditions based on your Product Feeds, click Apply in the bottom right corner of the Conditional Mapping card.

  8. To delete a mapping, click the Delete icon in the top-right corner of the Conditional Mapping card.

  9. Click Save in the top right corner to apply Dynamic Video Template to the feed.