Hubl in Email doesn't work as intented

I am building a simple email module where I want to list the line items of a deal.
I have set up a workflow to update 3 custom properties of a deal with Line Items Name, Price, Quantity, but I separate them by ‘;’ so far the workflow worflow works fine, I get values like this:
Property name: custom_line_items_name
Value: name1;name2;name3

Property name: custom_line_items_quantity
Value: 1;1;1

Property name: custom_line_items_price
Value: $30;$35;$40
When I get these values in the email module by this refference
deal.custom_line_items_name

deal.custom_line_items_quantity

deal.custom_line_items_price

I get the same values as above witch is what I want.
The problem arrives when I try to split them by ‘;’ and loop them though to place them correctly in a table. it seems that the split filter does not work at all, and neither replaceing the ‘;’ with something else, Anyone can help?
Below is the code I use:

{% set line_items_raw = deal.custom_line_items_name|string|trim %}
{% set quantities_raw = deal.custom_line_items_quantity|string|trim %}
{% set prices_raw = deal.custom_line_items_price|string|trim %}

{% set line_items = line_items_raw|split(‘;’) %}
{% set quantities = quantities_raw|split(‘;’) %}
{% set prices = prices_raw|split(‘;’) %}
The values I get from all the sets are similar to the ones without spliting at all.

Hey, @Robert_P :waving_hand: I think it’s related to this warning —

“Please note: You can apply HubL filters to personalization tokens, such as contact and company tokens, on HubSpot CMS and blog pages, but not in emails.”

Best,

Jaycee

Is there any way I can achieve the requirements that I am describing in the issue?

@Jaycee_Lewis any help on how can I achieve my goal?
Kind regards

You can just use line item properties in the email and loop through them with a code like this:

{% email_each list=“deal.line_items” item=“line_item” %}
{% set unit_price = line_item.price|regex_replace(“[^0-9.\\-]”, “”)|float %}
{% set quantity = line_item.quantity|float %}
{% set total = unit_price * quantity %}

Name: {{ line_item.name }}
Quantity: {{ quantity|int }}
Unit Price: {{ unit_price|format_number(‘en-US’, 2, ‘0.00’) }} {{ deal.deal_currency_code }}
Total: {{ total|format_number(‘en-US’, 2, ‘0.00’) }} {{ deal.deal_currency_code }}

{% endemail_each %}
Hit me up if you need help setting this up.