Skip to content
Discussion options

You must be logged in to vote

Hello @horhulenko

From what I found, you can now use addDocumentTab in batchUpdate to create a new tab. documents.create still ignores the tabs field because those fields are output-only.

const response = await docs.documents.batchUpdate({
  documentId,
  requestBody: {
    requests: [
      {
        addDocumentTab: {
          tabProperties: {
            title: "Second Tab"
          }
        }
      }
    ]
  }
});

The new tab's tabId is returned in addDocumentTab response. You can then use that tabId with insertText.

Official doc : https://developers.google.com/workspace/docs/api/how-tos/tabs

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by horhulenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants