Display Total Number of Submissions for a Form
If you wish to display the total number of submissions a Freeform form has received, you can do this by including the .count
function on the Submissions Query.
Instructions
Your template code would look as simple as this:
{{ freeform.submissions({formId: form.id}).count }}
A real-world example might look something like this:
{% set forms = freeform.forms %}
<h2>List of All Forms</h2>
{% for form in forms %}
<div class="form-card">
<h4>{{ form.name }}</h4>
<p>{{ form.description }}</p>
<p>{{ freeform.submissions({formId: form.id}).count }} Submissions</p>
</div>
{% endfor %}
Spam Count
If you'd like to display the total number of submissions in the spam folder for a form, just add isSpam: true
to the query:
{{ freeform.submissions({formId: form.id, isSpam: true}).count }}