I already found something, that comes close to my question.
I am using the append-method because that´s exactly what I need and it works very well. I am not sure if I´m missing something here or the "append" does not support any kind of DataValidation
.
Google shows in the example:
$response = $service->spreadsheets_values->append($spreadsheetId, $range, $requestBody);
the $requestBody
is just a simple array:
$values = [
[
0 => $str,
1 => $str,
2 => $str,
3 => $str,
4 => $str,
5 => $str,
6 => $str,
7 => $str,
8 => $str
],
// Additional rows ...
];
$body = new Google_Service_Sheets_ValueRange(['values' => $values]);
I don´t see any way to integrate this code:
$dv = new Google_Service_Sheets_DataValidationRule();
$b = new Google_Service_Sheets_BooleanCondition();
$b->setType('BOOLEAN');
$dv->setCondition($b);
I tested to add this as a value like:
$values = [
[
0 => $str,
1 => $str,
2 => $str,
3 => $str,
4 => $str,
5 => $str,
6 => $str,
7 => $str,
8 => $dv, /* <====== TRY TO ADD A CHECKBOX */
],
// Additional rows ...
];
but this only leads to errors telling me, the values have a wrong structure.
At this point, I have no idea if "appending" supports any kind of "data validation" or not.
Thanks for any help.