Google Docs API-更新链接表

时间:2019-02-19 18:07:05

标签: google-docs google-docs-api google-apis-explorer

我正在尝试使用新的API更新Google文档中的表格。表格是通过Google表格链接的。

我在Google Cloud中尝试了API资源管理器。我能够提取json格式的文档,然后过滤掉表格。但是在表json结构中,我找不到可以更新的任何内容,也没有找到将表链接至电子表格的任何内容。它是纯文本(来自电子表格中的单元格)。

在这里,我正在共享json中的一张表,其中有2行和1列,以“书面英语”和“口头英语”作为单元格值。

        "table": {
        "rows": 2,
        "columns": 1,
        "tableRows": [
        {
        "startIndex": 77,
        "endIndex": 95,
        "tableCells": [
            {
            "startIndex": 78,
            "endIndex": 95,
            "content": [
            {
            "startIndex": 79,
            "endIndex": 95,
            "paragraph": {
                "elements": [
                {
                "startIndex": 79,
                "endIndex": 94,
                "textRun": {
                "content": "Written English",
                "textStyle": {
                    "underline": true,
                    "foregroundColor": {
                    "color": {
                    "rgbColor": {
                    "red": 0.06666667,
                    "green": 0.33333334,
                    "blue": 0.8
                    }
                    }
                    },
                    "fontSize": {
                    "magnitude": 24,
                    "unit": "PT"
                    },
                    "weightedFontFamily": {
                    "fontFamily": "Arial",
                    "weight": 400
                    }
                }
                }
                },
                {
                "startIndex": 94,
                "endIndex": 95,
                "textRun": {
                "content": "\n",
                "textStyle": {
                    "foregroundColor": {
                    "color": {
                    "rgbColor": {
                    "red": 0.8784314,
                    "green": 0.16078432,
                    "blue": 0.42352942
                    }
                    }
                    },
                    "fontSize": {
                    "magnitude": 24,
                    "unit": "PT"
                    },
                    "weightedFontFamily": {
                    "fontFamily": "Arial",
                    "weight": 400
                    }
                }
                }
                }
                ],
                "paragraphStyle": {
                "namedStyleType": "NORMAL_TEXT",
                "lineSpacing": 115,
                "direction": "LEFT_TO_RIGHT",
                "spacingMode": "COLLAPSE_LISTS",
                "spaceAbove": {
                "unit": "PT"
                },
                "avoidWidowAndOrphan": false
                }
            }
            }
            ],
            "tableCellStyle": {
            "rowSpan": 1,
            "columnSpan": 1,
            "backgroundColor": {
            "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
            }
            },
            "borderLeft": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderRight": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderTop": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderBottom": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "paddingLeft": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingRight": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingTop": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingBottom": {
            "magnitude": 2,
            "unit": "PT"
            },
            "contentAlignment": "BOTTOM"
            }
            }
        ],
        "tableRowStyle": {
            "minRowHeight": {
            "magnitude": 15,
            "unit": "PT"
            }
        }
        },
        {
        "startIndex": 95,
        "endIndex": 112,
        "tableCells": [
            {
            "startIndex": 96,
            "endIndex": 112,
            "content": [
            {
            "startIndex": 97,
            "endIndex": 112,
            "paragraph": {
                "elements": [
                {
                "startIndex": 97,
                "endIndex": 111,
                "textRun": {
                "content": "Verbal English",
                "textStyle": {
                    "underline": true,
                    "foregroundColor": {
                    "color": {
                    "rgbColor": {
                    "red": 0.06666667,
                    "green": 0.33333334,
                    "blue": 0.8
                    }
                    }
                    },
                    "fontSize": {
                    "magnitude": 14,
                    "unit": "PT"
                    },
                    "weightedFontFamily": {
                    "fontFamily": "Raleway",
                    "weight": 400
                    }
                }
                }
                },
                {
                "startIndex": 111,
                "endIndex": 112,
                "textRun": {
                "content": "\n",
                "textStyle": {
                    "foregroundColor": {
                    "color": {
                    "rgbColor": {
                    "red": 0.8784314,
                    "green": 0.16078432,
                    "blue": 0.42352942
                    }
                    }
                    },
                    "fontSize": {
                    "magnitude": 14,
                    "unit": "PT"
                    },
                    "weightedFontFamily": {
                    "fontFamily": "Arial",
                    "weight": 400
                    }
                }
                }
                }
                ],
                "paragraphStyle": {
                "namedStyleType": "NORMAL_TEXT",
                "lineSpacing": 115,
                "direction": "LEFT_TO_RIGHT",
                "spacingMode": "COLLAPSE_LISTS",
                "spaceAbove": {
                "unit": "PT"
                },
                "avoidWidowAndOrphan": false
                }
            }
            }
            ],
            "tableCellStyle": {
            "rowSpan": 1,
            "columnSpan": 1,
            "backgroundColor": {
            },
            "borderLeft": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderRight": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderTop": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "borderBottom": {
            "color": {
                "color": {
                "rgbColor": {
                "red": 1,
                "green": 1,
                "blue": 1
                }
                }
            },
            "width": {
                "magnitude": 0.75,
                "unit": "PT"
            },
            "dashStyle": "SOLID"
            },
            "paddingLeft": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingRight": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingTop": {
            "magnitude": 2,
            "unit": "PT"
            },
            "paddingBottom": {
            "magnitude": 2,
            "unit": "PT"
            },
            "contentAlignment": "BOTTOM"
            }
            }
        ],
        "tableRowStyle": {
            "minRowHeight": {
            "magnitude": 15,
            "unit": "PT"
            }
        }
        }
        ],
        "tableStyle": {
        "tableColumnProperties": [
        {
            "widthType": "FIXED_WIDTH",
            "width": {
            "magnitude": 363,
            "unit": "PT"
            }
        }
        ]
        }
        }

简而言之,我正在尝试以编程方式对Google文档中的链接表执行“更新”按钮。

期待任何帮助。 谢谢。

1 个答案:

答案 0 :(得分:1)

已创建问题here in the issuetracker。在该问题上加注星标(在左上角),以帮助Google优先考虑该问题!