Skip to content

PDF / email template: List uploaded file names from within repeater field? #1566

Answered by engram-design
mandrasch asked this question in Q&A
Discussion options

You must be logged in to vote

I would suggest brushing up on how rendering submission content works as that'll guide you through most cases.

But for your exact use-case:

{% set rows = submission.getFieldValue('myRepeaterField').all() %}

{% if rows | length %}
    <ul>
        {% for row in rows %}
            <li>
                {% set assets = row.getFieldValue('myFileUploadField').all() %}

                {% for asset in assets %}
                    {{ asset.filename }}
                {% endfor %}
            </li>
        {% endfor %}
    </ul>
{% else %}
    No uploads found.
{% endif %}

Keep in mind that a Repeater field is much like a Matrix or Super Table field, and a File Upload field is an Assets field. …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mandrasch
Comment options

@engram-design
Comment options

Answer selected by mandrasch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants