I have an app, which manages Google drive structure and updates existing Google sheets. On all of those Sheets documents, I came across strange behaviour. Once I add some amount of data (at around 80-100 entered rows), the spreadsheet stops applying some formatting over data.
App is C# / .NET Standard (4.7.2), using Google.Apis.Sheets.v4 nuget and GoogleSheetsApi-V4 as endpoint.
Application creates and send batch update which contains both data and formatting (styles). Batch update is specific request as it is transactional - if any of the sub-requests will not be applied (e.g. request is not parsed via Google's server), whole request will not be applied (meaning all sub-requests get dropped).
I'm aware of request-count limits and I'm not hitting those. This behaviour occurrs on all tested files (around 50 in total) - first 80-100 rows are formatted without issues, the rest has problems.
Reply from the Google's API (after batch update request) is empty and doesn't report any error.
For the formatting I'm using batchRequest
with several requests
. I'm including them in the order as they are send and applied:
UpdateCells
with CellData.UserEnteredValue
MergeCells
UpdateCells
with CellData.UserEnteredFormat
UpdateBorders
RepeatCell
- ...
Does Google spreadsheets API have some limits for formatting? What might be the cause that formatting is lost at this part? Is there something I should be aware about that might be limiting this behaviour?
Screenshot of bad formatting at certain amount of data (e.g. WORD_WRAP, TEXT_ALIGNMENT is not set, but cells are still "bordered" and background color is set for the columns):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…