Skip to main content
Solved

Replacing space with hyphen / dash

  • June 27, 2023
  • 2 replies
  • 373 views

Forum|alt.badge.img+4

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

Best answer by JamesT

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

2 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • 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
Forum|alt.badge.img+1
  • Problem Solver I
  • 3 replies
  • Answer
  • March 20, 2024

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