admin管理员组文章数量:1123694
I am creating a Java application where I need to read google sheets, create objects from the row values and store them in the database. The problem is that I need to read not the whole sheet (tens of thousands rows) but only rows that are highlighted with certain colors. I did not find in the google docs how to set up this search criteria. If someone has done something similar, I will appreciate some pointers.
I am creating a Java application where I need to read google sheets, create objects from the row values and store them in the database. The problem is that I need to read not the whole sheet (tens of thousands rows) but only rows that are highlighted with certain colors. I did not find in the google docs how to set up this search criteria. If someone has done something similar, I will appreciate some pointers.
Share Improve this question asked yesterday Gary GreenbergGary Greenberg 1,1448 silver badges15 bronze badges 01 Answer
Reset to default 0Getting Values based on Background Color
As far as I know in the current stages of the Google Sheets API V4, getByDataFilter doesn't support filters using Cell Formatting. This could be processed from the Response received from Method: spreadsheets.get. By setting Parameters of range depending on your project and includeGridData
to True
.
Here's a sample response leaving behind part of the response which is not needed on your question.
Sample Response for Each Cell
{
"userEnteredValue": {
"stringValue": "PERSON A"
},
"effectiveValue": {
"stringValue": "PERSON A"
},
"formattedValue": "PERSON A",
"effectiveFormat": {
"backgroundColor": {
"red": 1,
"green": 1,
"blue": 1
},
"padding": {
"top": 2,
"right": 3,
"bottom": 2,
"left": 3
},
"horizontalAlignment": "LEFT",
"verticalAlignment": "BOTTOM",
"wrapStrategy": "OVERFLOW_CELL",
"textFormat": {
"foregroundColor": {},
"fontFamily": "Arial",
"fontSize": 10,
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"foregroundColorStyle": {
"rgbColor": {}
}
},
"hyperlinkDisplayType": "PLAIN_TEXT",
"backgroundColorStyle": {
"rgbColor": {
"red": 1,
"green": 1,
"blue": 1
}
}
}
}
References
spreadsheet.Get
本文标签: searchreading google sheet rows marked with certain colorsStack Overflow
版权声明:本文标题:search - reading google sheet rows marked with certain colors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736588456a1945042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论