Forums

Export to GSheet --> email field names?

Marysia 16 Oct, 2016
Hello,
I'm afraid it is a stupid question, but I get stuck and I think it would be easier to ask you for help🙂

In this moment after filling "my" form a user and the admin get an e-mail with information from the form. The form is not the simplest one, either is the e-mail.
So I print simple information, like:

<tbody>
<tr><td><strong>Name:</strong></td><td>{Name}</td></tr>
......
</tbody>

and use some conditional formatting as well, for example:

<?php
$intention = 1;
if ($form->data['intention'] === '1') 
    print "order";
elseif ($form->data['intention'] === '2')
    print "question about costs";
else
    print "other";
?>


Exporting part of data from a form to a Google Sheet would make life easier, so I found right page in the FAQ section (click), I went trough it and it works nicely, but after changing field name and field ID from [Name] to GSheet[Name] I don't know how to call it in an email. {GSheet[Name]} doesn't work, GSheet{[Name]} and {Name} either. So: what should I do to make it work? And How should I call form fields in php?

Thank you in advance🙂
Maria
GreyHead 17 Oct, 2016
Hi Marysia,

Please try {GSheet.Name} and $form->data['GSheet']['Name']

Bob
Marysia 20 Oct, 2016
Hi GreyHead,
you are a treasure🙂 (as always!)

I've started changing my form line by line (as I need to change not only field IDs/names, to GSheet[something], but also everything connected, email, actions... I don't want to get lost). So after first five fields I've checked if everything was working as I expected it to, and it wasn't. I was getting all the info in the mail when I call fields in the manner you wrote: {GSheet.Name}, but I was getting only two first fields in the Google Sheet. Finally I think I found the reason: I had field names like: "Phone_number" and names like this are not exported to the Sheet. After changing it to "Phone-number" it starts working.
GreyHead 20 Oct, 2016
Hi Marysia,

You reminded me that we looked at this once before a few months ago - see this post

Bob
This topic is locked and no more replies can be posted.