I am trying to use the "Replace Named Range Content Request" to update the content of table cells but I keep getting a this range cannot be replaced error, I also tried deleting the table cells content,not the table cell itself, but I got this error (
{
"error": {
"code": 400,
"message": "Invalid requests[0].deleteContentRange: Invalid deletion range. Cannot delete the requested range.",
"status": "INVALID_ARGUMENT"
}
}
)
I have cross-checked the indexes I am using and I can't figure it out, Insert Text request works but replacing or deleting the text in a table cell brings back an error.
Here is the body of one of my table cells in JSON format
"startIndex": 145,
"endIndex": 152,
"paragraph": {
"elements": [
{
"startIndex": 145,
"endIndex": 152,
"textRun": {
"content": "Item 1\n",
"textStyle": {}
}
My delete content request in JSON format
{
"requests": [
{
"deleteContentRange": {
"range": {
"startIndex": 145,
"endIndex": 152
}
}
]
}
I created a named range with the table cell content start and end indexes and I was expecting it to automatically replace the text in the cell when I use "Replace Named Range Content Request"