How to make line item table one row long

Hi everyone, I’m having a problem with a HubSpot table.

It’s loading the line items associated with the deal individually:

I want to sort of unify them into a single line, but preferably by having some fields ignore certain parts.

Specifically, the second line item should appear with a value in the last part of the table “Setup” because the line item has the name “Setup” included, while the others pull items from the first line item, witch dont have.
Is there such a way?

<!-- Tabela de valores -->
<div class=“container–content”>
<table class=“tabela”>
<thead>
<tr style=“background-color: #f9b915;”>
<th>Assinaturas Anual</th>
<th>Valor por Assinatura</th>
<th>Investimento Mensal</th>
<th>Investimento Anual</th>
<th>Setup</th>
</tr>
</thead>
<tbody>
{% for item in line_items %}
<tr>
{# Assinaturas Anual (quantidade * 12) #}
<td>{{ item.quantity * 12 }}</td>
{# Valor por Assinatura #}
<td>
{{ item.price| format_currency(‘pt-BR’,‘BRL’) }}
</td>
{# Investimento Mensal (só se o item for ‘professional’) #}
<td>
{% if “professional” in item.name|lower %}
{% if item.hs_post_tax_amount %}
{{ item.hs_post_tax_amount| format_currency(‘pt-BR’,‘BRL’) }}
{% else %}
R$ 0,00
{% endif %}
{% else %}
R$ 0,00
{% endif %}
</td>
{# Investimento Anual (valor * 12) #}
<td>
{% if item.hs_post_tax_amount %}
{{ (item.hs_post_tax_amount * 12)|| format_currency(‘pt-BR’,‘BRL’) }}
{% else %}
R$ 0,00
{% endif %}
</td>
{# Setup: Só exibe se o item for “SETUP” #}
<td>
{% if “setup” in item.name|lower %}
{{ item.hs_post_tax_amount| format_currency(‘pt-BR’,‘BRL’) }}
{% else %}
-
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

<div style=“margin-top: 16px; font-size: 16px;”>
{{ DEAL.observacoes_da_proposta___assinei }}
</div>

</div>

Hey, @ViniBernardo :waving_hand: Just to clarify, are you doing this in a custom quote template? Or is this for a different template-type? Thanks! — Jaycee

Hi @ViniBernardo
To show all line items in a single row, you need to aggregate values before rendering instead of looping with {% for item in line_items %}. Example:

{% set total_subscriptions, total_monthly, total_annual, setup_value = 0,0,0,0 %}
{% for item in line_items %}
 {% set total_subscriptions = total_subscriptions + (item.quantity * 12) %}
 {% if "professional" in item.name|lower %}{% set total_monthly = total_monthly + item.hs_post_tax_amount %}{% endif %}
 {% set total_annual = total_annual + (item.hs_post_tax_amount * 12) %}
 {% if "setup" in item.name|lower %}{% set setup_value = setup_value + item.hs_post_tax_amount %}{% endif %}
{% endfor %}
<tr>
 <td>{{ total_subscriptions }}</td>
 <td>-</td>
 <td>{{ total_monthly|format_currency('pt-BR','BRL') }}</td>
 <td>{{ total_annual|format_currency('pt-BR','BRL') }}</td>
 <td>{{ setup_value|format_currency('pt-BR','BRL') }}</td>
</tr>

Refrence doc: HubL Syntax - HubSpot docs
Thanks

Hey @ViniBernardo,

Are you trying to do this in a custom quote template?

Regards,