You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 - you need a google account
2 - Create your form using Google Forms
3 - Enable Sheets API, documentation here
4 - Register/Create a YF custom workflow
5 - Write your custom php script and do what you want.
My script starts like this :
<?php
require_once '/path/to/google-api-php-client/vendor/autoload.php';
$client = new \Google_Client();
$client->setApplicationName('My_CRM');
$client->setScopes([\Google_Service_Sheets::SPREADSHEETS]);
$client->setAccessType('offline');
/*
* The JSON auth file can be provided to the Google Client in two ways, one is as a string which is assumed to be the
* path to the json file. This is a nice way to keep the creds out of the environment.
*
* The second option is as an array. For this example I'll pull the JSON from an environment variable, decode it, and
* pass along.
*/
$client->setAuthConfig(__DIR__ . '../path/to/your_credentials.json');
$sheets = new \Google_Service_Sheets($client);
/*
* To read data from a sheet we need the spreadsheet ID and the range of data we want to retrieve.
* Range is defined using A1 notation, see https://developers.google.com/sheets/api/guides/concepts#a1_notation
*/
$spreadsheetId = 'REPLACE_WITH_YOUR_SPREADSHEET_ID';
$range = "'YOUR_SHEET_NAME'";
$rows = $sheets->spreadsheets_values->get($spreadsheetId, $range);
$data = $rows->getValues();
foreach($data as $key => $value) {
//do your stuff
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1 - you need a google account
2 - Create your form using Google Forms
3 - Enable Sheets API, documentation here
4 - Register/Create a YF custom workflow
5 - Write your custom php script and do what you want.
My script starts like this :
Integrating Google Sheets API with PHP
I'm not a programmer so there may be a better way but it works very well for me.
Regards
Original thread : #13204
All reactions