Skip to main content
Contributor I
June 27, 2023
Solved

Replacing space with hyphen / dash

  • June 27, 2023
  • 2 replies
  • 508 views

Hello everyone, 

I’m trying to replace the space in a Variable Name with hyphens.

I’ve tried handleize, replace but nothing seems to work. For a bit more context, in the end I will add this to complete the link/URL for a product.

Example.


What the variable show ups like
Example Variable Name


What I want the variable to display as
Example-Variable-Name

    This topic has been closed for replies.
    Best answer by JamesT

    Use {{ event.extra.line_items.0.product.handle|default:'' }} instead of {{ event.Items.0|default:'' }}.

    2 replies

    Brian Turcotte
    Klaviyo Alum
    June 28, 2023

    Hi @kb_somm!

    May I ask if you would provide a little more context about which variable you are trying to change, and where within Klaviyo you’re trying to exact the change?

     

    I think it’ll help myself and other Community members understand the issue better if we had a little more context. If you’re talking about applying a filter to modify the content of a dynamic variable in an email, then you might find this Community thread helpful in the meantime:

     

    Best,

    Brian

    JamesT
    Problem Solver I
    JamesTAnswer
    Problem Solver I
    March 20, 2024

    Use {{ event.extra.line_items.0.product.handle|default:'' }} instead of {{ event.Items.0|default:'' }}.