Buy Now
Sign in

Write on Google spreadsheet

damconsulting , July 05 2016
d
damconsulting

Dears,
i need someone who can correctly configure chronoforms to write datas on a Google spreadsheet.
I follow some tutorial found on this site, but without success.
Can anyone help me?
I can pay for it.
Thank you.
DAM

calculus00

Hello damconsulting,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How do I use the Google Spreadsheet Save action?
P.S: I'm just an automated service ;)

I'm an automated service, my answers may help, but they may not be accurate.

GreyHead

Hi DAM,

What exactly is the problem you are seeing? Have you checked the FAQ that Prof Calculus linked to?

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

I followed that tutorial but when I click on submit button I obtain an error:
401 - Error refreshing the OAuth2 token, message: '{ "error" : "invalid_client", "error_description" : "The OAuth client was invalid." }'

I checked it twice and made cut/paste from Google console.
Any idea?
Thank you.
DAM

GreyHead

Hi DAM,

Does this StackOverFlow answer help?

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

Followed.

New error:
0 - Could not create storage directory: /tmp/Google_Client/f7

...:-(

GreyHead

Hi DAM,

Does the folder exist? And is it writable by the Joomla! server user?

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

The folder did not exist; so I created it and I assigned 777 permission.
But it still doesn't work...
Always: 0 - Could not create storage directory: /tmp/Google_Client/f7

GreyHead

Hi DAM,

Please check with your web-host. If you are on a shared server it may not be possible to write to that folder. Please see this StackOverFlow answer for some suggestions.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

Well, I changed server and now it works. Thank you.

I've a little problem: my form has some "Text Box" fields that I named:
GSheet[field1]
GSheet[field2]
...
and i insert this value in Filed Name and in Field ID.

I need to generate also an email with datas, but when I insert this field {GSheet[field1]} in email html template, i receive a blank message.

Any idea?
Thank you.

GreyHead

Hi damconsulting,

In the email template please use {GSheet.field1}

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

It works fine, thank you.

Another little problem... :shock:

In my form, I collect date and time of submission with a php script which fills 'text11' field.
<?php
$form->data['text11'] = date('d-m-Y H:i:s');
?>
Can I pass it to Google spreadsheet? I try to change text11 with GSheet[text11] but it doesn't work.

Last question: i use an incremental identification of submission, using {id} value. It works fine when i send this information by email but... can i pass this value also to Google spreadsheet?

Thank you very much.
DAM

GreyHead

Hi damconsulting,

Please try

				<?php
$form->data['Gsheet']['text11'] = date('d-m-Y H:i:s');
?>


Where are you getting the incremental id from? You should be able to save it if you add the value to $form->data['Gsheet']['id']

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

Wow, it works fine.



ID is the position on database rows; it's the only way i know to have unique incremental number.
Is there any php code to generate unique incremental number?

Thank you.

Attachments
array3.jpg
array3.jpg
(89.25 KiB)
108 Downloads/Views
GreyHead

Hi damconsulting,

If you want a serial number then using the record id from a database table is probably the best way. If you want a unique identifier that is random so can't be easily guessed then I have a custom action that will let you do that.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

I need only an incremental serial number.
Any idea on how I can pass it to the array?
Thank you.

GreyHead

Hi Damconsulting,

Use a Custom Code action after the DB Save and before the GSheet Export action:

				<?php
$form->data['Gsheet']['id'] = $form->data['id'];
?>

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

Hi Bob, i try the custom code but it seems not to work... :(
I put the action between DB Save and before GShee actions but [id] array filed is still blank.
Thank you.
DAM

GreyHead

Hi DAM,

Sorry I missed the = sign :-( Code is now updated.

Bob

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much

d
damconsulting

Great! :D