How to access value from sales quote and display in custom report

I want to access value from sales quote and display in printable quotation.
like i can access value by this code… {{ row.cells[3].text}} but i want to get value for that cells by cell name. then display.
i created custom fields like vehicle brand name, Vehicle color, etc. now i want to get the particular filed values by that field name.
looking for help.

1 Like

Accessing cells by column name is not yet possible. The only way to do this currently would be to loop through columns to capture index numbers of columns you are interested in and then use this information when accessing cells. A bit cumbersome.

But I think this is a good idea and should be added.

thanks for prompt reply
problem is when i add discount then the array index value change then wrong value will fetch and display on quote.

That’s why in your theme, you need to loop through all columns to find the index of column you are looking for.

For example, this code will assign to myIndex variable index of column named Unit price.

{% for column in table.columns %}
    {% if column.label == "Unit price" %}
        {% assign myIndex = forloop.index0 %}
        {% break %}
    {% endif %}
{% endfor %}

Then you can use myIndex variable instead of your hard-coded number such as:

{{ row.cells[myIndex].text}}

great
its work for me perfect
thanks