Following Sprout Forms -- How to link to individual entries on the front-end I found code
{% set formEntryId = craft.request.getSegment(2) %}
{% set entry = craft.sproutForms.getEntryById(formEntryId) %}
but it doesn't have any field data. Including {{ dump(entry) }}
in my template shows object(barrelstrength\sproutforms\elements\Entry)
with a lot of structure but no user entered values.
I was actually hoping to reuse my custom form templates (Sprout Forms > Settings > General > Default Form Templates) so it'll cycle through all the field templates like when the user filled in the form but I just want to show values if the form has already been submitted.
entry
does not contain useful values? Sometimes they are just difficult to spot when youdump
the objectvalue="{{ value }}"
so I should see the value there, no?$entry = SproutForms::$app->entries->getEntryById($entryId);
and then a few lines laterCraft::$app->getContent()->populateElementContent($entry);
before they render the edit entry template. Do I need to find a way to do that in my template to view a Sprout Forms entry?{% do craft.app.getContent().populateElementContent(entry) %}
it could be they lazy load it for certain reasons