I'm following the google guide and want to create a spreadsheet with populated cells. I've played with API Explorer and got the following working request body:
{
"sheets": [
{
"data": [
{
"startRow": 0,
"rowData": [
{
"values": [
{
"userEnteredValue": {
"stringValue": "foo"
}
}
]
}
]
},
{
"startRow": 1,
"rowData": [
{
"values": [
{
"userEnteredValue": {
"numberValue": 10
}
}
]
}
]
}
]
}
]
}
If I pass it as arguement it gives expected result(i.e. creates spreadsheet with data):
request_body = Google::Apis::SheetsV4::Spreadsheet.new(the_request_hash)
response = service.create_spreadsheet(request_body)
Is there a better and more readable way to create populated spreadsheets using ruby?