Custom CSV File Name?

User 2690548 Photo


Registered User
21 posts

In Settings... Saving Data... is it possible to save to a file name based on a field in the form? Also, can parameters be passed via URL string into the Form?

I've had to split my form into several smaller forms due to size/performance issues, and will be using the "Redirect to another URL" to get from one form to another until they're complete. I'm wanting a single CSV file for each set of forms.

For example, the resulting fileName would be something like 123Jackson.csv, based on a field StreetAddress that would be on each form.

Additionally, is it possible to pass a parameter into the form based on the URL?

I'm guessing a custom PHP will be suggested... if absolutely necessary, it would have to be simple! For one, I've never done PHP (decent but self-taught in HTML, javascript, vb). For two, I'll be going away at some point, and the 'real' sumpter will be maintaining this, and he's not a coder.

Thanks for any help y'all can provide!
User 187934 Photo


Senior Advisor
20,271 posts

Hi Sumpter,
This would require a significant amount of alterations to the form code and lots of testing to get it correct. You might be better off writing your own myformname.php to process the data. It almost seems like you might be better of using mysql.
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 2690548 Photo


Registered User
21 posts

Other than my personal home page, I've been away from this stuff for many many years. I would think it'd be easy enough to pass a parameter in a URL.

Just looked at datasavecsv.cls.php -- thinking that's where'd I work to get the custom CSV file name. Holler if I'm off-base, which I probably am!
User 2690548 Photo


Registered User
21 posts

Regarding passing parameters in the URL. Finally got back to that, and the solution was fairly straight forward. What this does for me is allow me to send a custom URL with different .search for each submission. Using the same Form (actually, set of forms, all of which will be completed for a single "submission"), the received submissions will be easily identified by tracking the identifier originally sent to the user.

Now just have to figure out the custom csv file name -- still prefer not to have to go outside of WFB to do it, as it will be maintained by a total non-coder, as opposed to me, a non-php'er.

First, just append "?important stuff here" after the URL so it's available in the .search parameter.

Create a text field, make it read only. I named mine bidid, used below in the redirect.

Put the following in an HTML element after doing a 'preview' to get the id of the text field just created:
<script type="text/javascript">
var elem2 = document.getElementById("item15_text_1");
var q = parent.location.search;
var b = (q.replace('?', '') );
elem2.value = b ;
</script>

Then, custom HTML for the redirect in settings:
<META HTTP-EQUIV="REFRESH" CONTENT="0;http://www.craytonclan.com?[bidid]">
In actual use, the URL above would be the next php in the series, I had to split my form into 9 forms because of size.
User 2690548 Photo


Registered User
21 posts

Here's a link to my test. The 'Submit' just opens another instance of the same doc with the ?33333 appended to the URL (or whatever's manually entered following the ?).

http://sumpterconstructionllc.com/CC/TEST.php?33333

Long shot, but I tried to incorporate "[bidid]" in the csv file name, hoping it would be similar to using it in the redirect HTML (which works). Of course, the file name just comes out [bidid].csv.

Like I've said, hoping to keep this in WFB, so when I go away and the 'real' Sumpter takes over he won't have any problems maintaining it all. A little bit of coding (maybe the form.cfg.php?) would be ok, and may not be avoidable.
User 187934 Photo


Senior Advisor
20,271 posts

If your altering the code the form builder generates outside that app you are no longer keeping it within the form builder. If some change is made in the form builder and exported all the alterations that were done by you will be lost if their not noted and kept track of for their replacement.:)
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 2690548 Photo


Registered User
21 posts

Yeah, Eric, I understand that. At this point, I've only made changes within the application.
User 187934 Photo


Senior Advisor
20,271 posts

So you looking to set a dynamic csv name for each submission or form?
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 2690548 Photo


Registered User
21 posts

Yessir. My Form has become 9... Scope-creep! So all 9 will have the same csv. And 'Dynamic' much more descriptive than my "Custom'.

Hoping to have the name of the csv based on the .search parameter that gets passed through all the forms from the initial URL. Passing the parameter works fine, just using it to name the csv is the problem. Also need to deal with directory, since all 9, even if same name, will be in 9 different directories.

Thanks for your patience... might not've been too clear from the outset. Hopefully I'll have something to contribute someday, rather than just sucking up knowledge!

I can work with 9 different files of the same name in 9 different directories, but in a perfect world, one file for all 9 related forms, with each appending.
User 187934 Photo


Senior Advisor
20,271 posts

I just helped a user write a custom script that will combine all your csv's into one. This requires no altering of the form scripts.:)
http://www.coffeecup.com/forums/web-for … post234039
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.