Forum

Thread tagged as: Question, Forms

Accessing form submission data in templates

If I set up a form using the Forms app, is there a way to access the submitted data in templates?

Specifically, is there a way to access the data the user just submitted? Will it still be there in POST data? (Obviously it will need to be validated/sanitised before being displayed/used)

(Would be useful to know if there's a way to access generic form submission data on the front end too). I guess you can just run a query, but I wondered if there's a function to do this, or an approved way?

Paul Bell

Paul Bell 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's not something the basic Forms app does, no. It's designed for simple form-to-email.

OK, thanks Drew.

If the user is logged in when he submits his form you could save his username in the form and then make a MySQL query to fetch all the submissions he made. Then pass that into the template as a variable.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think it really makes sense to do that. At that point you might as well just build an app to do what you want - why hack around with an app that doesn't?