Google Docs API-更新链接表 [英] Google Docs API - Update linked tables

查看:77
本文介绍了Google Docs API-更新链接表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to update tables in Google Documents with the new API. Tables are linked from a Google Sheet.

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

I tried the API explorer in google cloud. I am able to extract the document in json format and then filter out the tables. But within the table json structure, I do not find anything that I can update, I do not find anything that links the table to a spreadsheet. It is plain text (from the cells in the spreadsheet).

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

Here I am sharing one table from the json, with 2 rows and 1 column with "Written English" and "Verbal English" as cell value.

        "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文档中的链接表执行更新"按钮.

In short, I am trying to programmatically do what "UPDATE" button does on a linked table in Google Docs.

期待任何帮助. 谢谢.

Looking forward to any help. Thanks.

推荐答案

此处issuetracker .在该问题上加注星标(在左上角),以帮助Google优先考虑该问题!

The issue is created here in the issuetracker. Star(on the top left) the issue to help Google priorotize the issue!

这篇关于Google Docs API-更新链接表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆