Buy Now
Sign in

how to save form data in a csv file

lucadonati , June 14 2017, 17:22
L
lucadonati 10
June 14 2017, 17:22 #369416
Hi,
in a contact form I set a csv file and I successfully attached it to the email but I don't know how to include the submitted data in it.

The csv file I received contains:

"4,test-form,test-form,1,1,,Array,Array,Array,Array,Array,Array,Array"

I should like to receive only the submitted data as name, email, subject an so on.
Could you explain me how?

Thank you

Luca
Attachments
Schermata_2017-06-14_alle_18.54.13.png
Schermata_2017-06-14_alle_18.54.13.png
(47.21 KiB)
856 Downloads/Views
Schermata_2017-06-14_alle_18.54.52.png
Schermata_2017-06-14_alle_18.54.52.png
(21.56 KiB)
708 Downloads/Views
admin 28
June 14 2017, 22:42 #369429
Hi Luca,

In the "Data provider" please add {data:}

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
L
lucadonati 10
June 15 2017, 07:42 #369437
Hi Max,
I tried several conbination (one file attached) but the csv file I get is empty.
I'm not a coder, could you tell me the exact syntax to insert several field data in the "Data provider"?
Do I miss something else?

Thank you

Luca
Attachments
Schermata_2017-06-15_alle_09.34.25.png
Schermata_2017-06-15_alle_09.34.25.png
(51.58 KiB)
765 Downloads/Views
admin 28
June 15 2017, 21:21 #369456
Hi Luca,

All your settings were correct, only the "Data provided" had to be set to {data:}

But, I think that this might not work as expected too, since the CSV expects a data list, do you need to create a CSV file with only 1 row of data ?

If this is the case then you will need a PHP action before the CSV and use this code:
return [$this->data];


Then in the CSV data provider: {var:php_name}

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
L
lucadonati 10
June 16 2017, 15:11 #369484
Hi Max,
yes, I need to create a CSV file with only 1 row of data.

I tried your solution and I got a file containing the following 2 row:

option,chronoform,event,name,cognome,email,subject,message,autorizzo,secicon10,button9,Itemid
com_chronoforms6,test-form,submit,"First name","Last name",email@domain.ext,"Test form",Message...,1,5943ba9ee5645,,

As I said the best for me will be 1 row of data, the first row should not be there, is it possible?

I did some tests and I could get a file with 1 row of clean data:

1. I set CSV action as in setup_1.png attached and I got a file containing the following 2 row:

"Last name","First name",email@domain.ext,"Test form 2",Message...
6,test-form-2,test-form-2,1,1,,Array,Array,Array,Array,Array,Array,Array

2. I inserted in the "Data provided" the text "name" (see setup_2.png attached), I think it is wrong instruction but probably it prevents the second row to be included in the CSV file, so I got just 1 row of clean data:

"Last name","First name",email@domain.ext,"Test form 3",Message...

What you think about it?

Thank you

Luca
Attachments
setup_1.png
setup_1.png
(56.58 KiB)
743 Downloads/Views
setup_2.png
setup_2.png
(57.55 KiB)
684 Downloads/Views
admin 28
June 18 2017, 00:02 #369513
 Answer
Hi Luca,

I have added a new setting to disable the first line of header titles, please send me a message using the Contact us page to get the file and test it.

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
L
lucadonati 10
June 19 2017, 07:33 #369546
Hi Max,
yes, this is enough for my project.
Will you include the new setting in the next ChronoForms v6 release?

One last question, I should like to attach the csv file only to my client and not to the person who submit the form, can I just use 2 different email actions to handle it?

Thank you

Luca
GreyHead 64
June 19 2017, 07:45 #369548
 Answer
Hi Luca,

Yes you can use two different email actions to send different emails to the client and the user.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
lucadonati 10
June 19 2017, 07:48 #369549
Hi Bob,
thank you for your quick reply.

Luca