Power Apps Portal - Entity List Column Name Override

246 views Asked by At

Does anyone know the liquid template variable name for using the column name override instead of the name defined in the view?

<th width="{{ c.width }}" class="govuk-table__header" data-logicalname="{{ c.logical_name }}">
    {% if c.sort_enabled %}
        {% assign current_sort = order | current_sort:c.logical_name %}
        {% case current_sort %}
            {% when 'ASC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}"><i class="fa fa-sort-asc"></i>
                {{ c.name }}
                </a>
                {% when 'DESC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc"></i>
                {{ c.name }}
                </a>
                {% else %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc fa-rotate-270"></i>
                {{ c.name }}
                </a>
            {% endcase %}
    {% else %}
        {{ c.name }}
    {% endif %}
</th>

I'm currently using c.name but I want the name to inherit the column name attribute in the entity list configuration.

1

There are 1 answers

0
CLiown On

ASAIK this isn't possible, you need to add the logic to the template to rename the column name, see 'XXXXXXXXXX' below:

{% if c.logical_name == "XXXXXXXXXX" %}


<th width="{{ c.width }}" class="govuk-table__header" data-logicalname="{{ c.logical_name }}">
    {% if c.sort_enabled %}
        {% assign current_sort = order | current_sort:c.logical_name %}
        {% case current_sort %}
            {% when 'ASC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}"><i class="fa fa-sort-asc"></i>
                XXXXXXXXXX
                </a>
                {% when 'DESC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc"></i>
                XXXXXXXXXX
                </a>
                {% else %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc fa-rotate-270"></i>
                XXXXXXXXXX
                </a>
            {% endcase %}
    {% else %}
        {{ c.name }}
    {% endif %}
</th>
{% else %}
<th width="{{ c.width }}" class="govuk-table__header" data-logicalname="{{ c.logical_name }}">
    {% if c.sort_enabled %}
        {% assign current_sort = order | current_sort:c.logical_name %}
        {% case current_sort %}
            {% when 'ASC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}"><i class="fa fa-sort-asc"></i>
                {{ c.name }}
                </a>
                {% when 'DESC' %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc"></i>
                {{ c.name }}
                </a>
                {% else %}
                <a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}"><i class="fa fa-sort-desc fa-rotate-270"></i>
                {{ c.name }}
                </a>
            {% endcase %}
    {% else %}
        {{ c.name }}
    {% endif %}
</th>
{% endif %}