I would like to hide rows in a document using python, to authomatize a project, but I tried with spread and there is no option.
So I would like to know if there's any possibility to do it using python
I believe your goal and your current situation as follows.
In this case, I think that your goal can be achieved using UpdateDimensionPropertiesRequest with the method of batch_update
. When this is reflected to the script, it becomes as follows.
client = gspread.authorize(credentials) # Please use your authorization script for this.
spreadsheetId = "###" # Please set your Spreadsheet ID.
sheetName = "Sheet1" # Please set the sheet name.
spreadsheet = client.open_by_key(spreadsheetId)
sheetId = spreadsheet.worksheet(sheetName).id
body = {
"requests": [
{
"updateDimensionProperties": {
"properties": {
"hiddenByUser": True
},
"range": {
"sheetId": sheetId,
"dimension": "ROWS",
"startIndex": 1,
"endIndex": 10
},
"fields": "hiddenByUser"
}
}
]
}
spreadsheet.batch_update(body)
spreadsheetId
are hidden.