You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using googleapis 155.0.1 and want to create a document with two tabs and write content in them.
I found that there's a method docs_v1.Resource$Documents.create, which apparently accepts as a parameter object with requestBody of type Schema$Documentwhich itself lets to specify the tabs field. Unfortunately, however, the commentary on usage states the following:
Creates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.
Indeed, the filled tabs field is ignored, and an empty document with the one default tab is created.
Then I thought that if create didn't work, maybe batchUpdate would help me, but I was unsuccessful there too. batchUpdate takes as its first parameter an object of type Params$Resource$Documents$Batchupdate, consisting of documentId and requestBody of type Schema$BatchUpdateDocumentRequest.
Schema$BatchUpdateDocumentRequest can contain only two parameters: requests of type Schema$Request and writeControlSchema$WriteControl. According to the description «A list of updates to apply to the document», it is the requests parameter that should be of interest to me.
And that's where I stopped, not knowing what else to do. Schema$Request has the following options:
insertText of type Schema$InsertTextRequest has location of type Schema$Location which has tabId and the following comment...
The tab that the location is in. When omitted, the request is applied to the first tab. In a document containing a single tab: - If provided, must match the singular tab's ID. - If omitted, the request applies to the singular tab. In a document containing multiple tabs: - If provided, the request applies to the specified tab. - If omitted, the request applies to the first tab in the document.
So if I don't provide it, text will just be placed in the first tab. If I do provide tabId, it's allowed only to be the same tabId as the first tab, meaning I just can't create new tab with text using insertText
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using
googleapis 155.0.1and want to create a document with two tabs and write content in them.I found that there's a method
docs_v1.Resource$Documents.create, which apparently accepts as a parameter object withrequestBodyof typeSchema$Documentwhich itself lets to specify thetabsfield. Unfortunately, however, the commentary on usage states the following:Indeed, the filled
tabsfield is ignored, and an empty document with the one default tab is created.Then I thought that if create didn't work, maybe
batchUpdatewould help me, but I was unsuccessful there too.batchUpdatetakes as its first parameter an object of typeParams$Resource$Documents$Batchupdate, consisting ofdocumentIdandrequestBodyof typeSchema$BatchUpdateDocumentRequest.Schema$BatchUpdateDocumentRequestcan contain only two parameters:requestsof typeSchema$RequestandwriteControlSchema$WriteControl.According to the description «A list of updates to apply to the document», it is the
requestsparameter that should be of interest to me.And that's where I stopped, not knowing what else to do.
Schema$Requesthas the following options:Which of these methods creates a new tab???
insertTextof typeSchema$InsertTextRequesthaslocationof typeSchema$Locationwhich hastabIdand the following comment...So if I don't provide it, text will just be placed in the first tab. If I do provide tabId, it's allowed only to be the same tabId as the first tab, meaning I just can't create new tab with text using
insertTextBeta Was this translation helpful? Give feedback.
All reactions