Hidden Date Field

Include a date stamp when saving form data to Google Sheets.

Overview

The issue occurs because Google Sheets' onEdit function only triggers with manual edits, not with data imports.
Add a Custom Code action in the On Submit event to set the date value before the export action runs.

Answered
md mduda 17 May, 2015
When I save my CF to Google, everything transfers. All is good. However, I need to find a way to include a date stamp. I have a script in Google, but it's not working because it's an onEdit function (which only updates when you are actually in the sheet making a change - the import does not affect it).

So, I was considering that maybe a better choice would be to add a hidden date field in my form. Can you provide guidance on how to do so? Or if you have a better CF solution?

Thanks!
Gr GreyHead 18 May, 2015
Answer
Hi Mduda,

In the On Submit event, add a Custom Code action before the Export action with code like this
<?php
$form->data['GSheet']['date'] = date('Y-m-d');
?>

Bob
md mduda 18 May, 2015
Perfect! Works like a charm! Thanks Bob!😀
This topic is locked and no more replies can be posted.