1

I've got a basic freeform form that posts to /forms/success/%%entry_id%%

In that /forms/success template, I have the following code:

        {exp:freeform:entries entry_id="{segment_3}" status=""}
        {if no_results}No results?{/if}
            <p>We have received the following data and will process it shortly.</p>
            <fieldset class="bg-white">
                {freeform:all_form_fields}
                <p>
                    <label>{freeform:field_label}</label>
                    {freeform:field_output}
                </p>
                {/freeform:all_form_fields}
            </fieldset>
        {/exp:freeform:entries}

Every time I post a form, I get redirected to the success template fine (with an entry_id as segment 3) but get the no results block every time. Data is being collected fine. I've tried setting status="open|pending" (as all new submissions are pending). I've also tried with and without dynamic="no" but that makes no difference. I can't see what I'm doing wrong (it may be obvious!)

This is freeform 4.2.2 on EE 2.10.1.

  • Try changing {if no_results} to {if freeform:no_results}? – Derek Hogue May 13 '15 at 14:50
  • no_results and freeform:no_results both work (I get 'No results?' on the page with either format) - my issue is that I have valid form data stored but can't access it with the freeform:entries tag above! :) – BellamyStudio May 13 '15 at 14:52
  • My thought was that no_results might be evaluating true whereas freeform:no_results might not. But alas. What if you remove that conditional entirely? – Derek Hogue May 13 '15 at 14:53
  • If I remove it then I just get the 'thank you' heading that's outside the freeform:entries pair. I only really added the no_results condition to make sure that something was happening inside the entries pair, and it confirms that the tags are parsing but not returning the data. I've checked the template debugger and it returns the following: (0.085134 / 17.29MB) Calling Class/Method: Freeform/entries (0.085533 / 17.29MB) -> Class Called: Freeform (0.110393 / 18.36MB) -> Method Called: entries (0.111629 / 18.40MB) Returning No Results Content – BellamyStudio May 13 '15 at 14:57
2

You need a form_id= in addition to an entry_id= because entry ids are per form, not globally unique.

| improve this answer | |
  • Thanks - so is what I want to do not possible? The form is generated by composer and I'm pushing the return address through as template parameters, but I can't do that with the form id (can I?) – BellamyStudio May 13 '15 at 16:19
  • You can't pass the form_id, but you should know the form_id or form_name (one or the other can be used as a parameter) from the form before submission. It would be the same value used in {exp:freeform:entries}. In other words, if you use {exp:freeform:composer form_id="1"}, then use {exp:freeform:entries form_id="1"} – Solspace May 14 '15 at 12:54
  • Thanks for coming back to me - sorry, this is my first time using composer - I'm currently using a simple field tag in my template and that's handling the whole form build from my custom composer template. You're saying I should use {exp:freeform:composer} tags in the template instead? If I do this, how do I access the form name that I entered in the control panel composer config? (I can see the params in the docs, but they don't seem to be for pulling in any dynamic information) – BellamyStudio May 14 '15 at 13:06
  • any advice for above? How can I pass a form_id in? If I don't use the channel field to generate the form but use freeform:composer instead, how do I know which entry they have assigned the form to? Is there a way I can append the form_id to the return url using the channel entry fieldtype (so I can do a segment check on the success template?) – BellamyStudio May 17 '15 at 7:37
  • If you have a Freeform form that users are submitting, you would be aware of which form was being submitted and could have it either submit to a different Entries page for each, or if you want a single template to handle Entries display for all forms, you could pass the form ID in the return URL of the submission form, and then pull it into the Entries tag template with the form_id="{segment_NUMBER}" parameter. – Solspace May 18 '15 at 20:22

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.