Forums

Call form data when used Gsheet

Andesch 30 Mar, 2015
I'm wondering how to write my email which is to be dynamically changed according to answers in the form. However i also want to save the information in a Google spreadsheet, hence i had to add the Gsheet before the field names. When i did that the data is no longer reached by the email php code. I managed to find in the forum where the dynamic email field should be written as Gsheet.email but cannot find how i should do in this case!
Gsheet[firstname1]
Gsheet[numberpeople]


is the field names
<?php
echo $form->data['Gsheet[firstname1]'];
?>
<br>
<?php
$Price = 1000;
$Cost = $Price * ($form->data['Gsheet[numberpeople]'] + 1);
echo $Cost;
?>
GreyHead 30 Mar, 2015
Answer
1 Likes
Hi Andesch,

The PHP syntax for a sub array is like this:
$Cost = $Price * ($form->data['Gsheet']['numberpeople'] + 1);
and to show a value in an email template it would be {Gsheet.numberpeople}

Bob
Andesch 31 Mar, 2015
Thanks! works great..
This topic is locked and no more replies can be posted.