Forum
Form App - Download CSV
I'm using the Form App in Perch and have a requirement to make a CSV file available outside of the Perch admin interface.
I think it may be possible to generate a CSV file of all of the form data using a template but I would very much appreciate a pointer on how this might be accomplished in practice.
If you log in and look at the form responses, there's a button to download a CSV.
In this instance I need to give a third party access for audit purposes and this access cannot be via the Perch admin interface, it needs to be outside of that via a URL.
That's not possible with the app as it stands.
How would you plan to authenticate it?
I realise that the app doesn't include that functionality but had seen a response from you to another question where the possibility of using a template to generate a CSV file was put forward.
Possibly authenticate via username & password set in htaccess file.
You can't output that information via a template.
OK, understood, that's a non starter.
Any suggestions / advice as to how to go about generating a CSV file from the Forms app stored data?
It would be simple to do, but you'd need to write some PHP to do it.
Is the following a valid basis to achieve SQL to CSV output or is there anything unique to Perch that I may need to know?
That code is using the old
mysql
extension which is no longer valid in modern PHP. Also you'll need to decode the form contents, which is stored as JSON.