Web Form: Submission to separate CSV...

User 2741325 Photo


Registered User
7 posts

Hello,
Have contacted support and they suggest this isn't something that the Web Form Builder does at this point but suggested I ask the question in the forums to see if someone has already developed a solution. Basically what I am chasing is when a form submission is complete for the results of the submission to be in its own CSV rather than appended to the one storage CSV. Preferrably named <contentsoffield1.csv>

A possible solution would be to append the data but to then copy that out into a new CSV immediately after.

thanks

Tom
User 187934 Photo


Senior Advisor
20,271 posts

This would be one way. :)
http://www.coffeecup.com/forums/web-for … post239552
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,271 posts

Here\'s what your redirect page could be setup like. this is basic with no styling.
see attached.
My script uses the stock form-result.csv
Attachments:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2741325 Photo


Registered User
7 posts

Thanks for your response, wow that other thread is pretty much identical to my question! I asked Support for this as a feature request as it seems like it would be a common train of thought for using the data post the form submission.

I will take a look through the code on Monday and see if I can make it all work :)

thanks

Tom
User 187934 Photo


Senior Advisor
20,271 posts

I\'ll post the code after they fix the ability to share code in the threads. The attachment has everything you need.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2741325 Photo


Registered User
7 posts

thanks again! :D
User 187934 Photo


Senior Advisor
20,271 posts

Adjust the yourname to the input name that you want to name the csv and the form-results to what you had set for the name of your csv in the form builder settings..
<?php

session_start();
$post = $_SESSION['post'];
$yourname = $post['yourname'];
$old_file_name = 'submit-to-own-csv/storage/csv/form-results.csv';
$new_file_name = 'submit-to-own-csv/storage/csv/'.$yourname.'.csv';
$renameResult = rename($old_file_name, $new_file_name);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="dcterms.created" content="Wed, 02 Sep 2015 17:32:46 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>

<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<?php
echo "Thanks " .$yourname.'<br>' ;

if ($renameResult == true) {
echo $old_file_name . "<br> is now named <br>" . $new_file_name;
} else {
echo "Could not rename that file";
}

?>
</body>
</html>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.