1

I'm using this code in my template

{% set formHandle = 'toad' %}
                         {% set submissions = craft.freeform.submissions({
                              form: formHandle,
                            status: ["open"],
                         }) %}

                         {# <h3>Submissions for {{ form.name }}</h3> #}


                         {% if submissions is empty %}
                         <h4>There are no submissions</h4>

                         {% else %}

                         <table class="table">

                              <thead>
                                   <tr>
                                        {% set myfield = (submissions|first).fieldMetadata.status('open) %}

                                        <th>{{ myfield.toadName.label }}</th>
                                        <th>{{ myfield.toadProfile.label }}</th>
                                   </tr>
                              </thead>

                              <tbody>

                                   {% for submission in submissions %}
                                   <tr>
                                        <td>
                                             {{ submission.toadName.value }}   
                                        </td>

                                        <td>
                                             {{ submission.toadProfile.value }}   
                                        </td>
                                   </tr>
                                   {% endfor %}

                              </tbody>

                         </table>

                         {% endif %}

But get the error:

Error Info: Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'sub_freeform_statuses.handle' in 'where clause'
)
↵
Caused by: PDOException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sub_freeform_statuses.handle' in 'where clause'

Is it possible to show just form entries with an open status only? without status: ["open"], the template works fine

1

Have you tried the syntax for one status rather than an array?

{% set submissions = craft.freeform.submissions({
      form: formHandle,
      status: "open",
}) %}

Ref: http://docs.solspace.com/craft/freeform/v2/template-functions/freeform.submissions.html#param-status

| improve this answer | |
  • Thanks John, no tried that I don't understand why its throwing an error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sub_freeform_statuses.handle' in 'where clause' – Kev N Jun 22 '19 at 21:16
  • Actually I used {{ submission.toadProfile }} not {{ submission.toadProfile.value }} syntax and now all good cheers – Kev N Jun 22 '19 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.