Skip to content

Commit

Permalink
fix: advanced docs params after id (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoehnelt authored Oct 16, 2024
1 parent f9a39af commit 3a18325
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion advanced/docs.gs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function insertAndStyleText(documentId, text) {
function readFirstParagraph(documentId) {
try {
// Get the document using document ID
const document = Docs.Documents.get({'includeTabsContent': true}, documentId);
const document = Docs.Documents.get(documentId, {'includeTabsContent': true});
const firstTab = document.tabs[0];
const bodyElements = firstTab.documentTab.body.content;
for (let i = 0; i < bodyElements.length; i++) {
Expand Down
11 changes: 2 additions & 9 deletions docs/quickstart/quickstart.gs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
*/
function printDocTitle() {
const documentId = '195j9eDD3ccgjQRttHhJPymLJUCOUjs-jmwTrekvdjFE';
try {
// Get the document using document id
const doc = Docs.Documents.get({'includeTabsContent': true}, documentId);
// Log the title of document.
console.log('The title of the doc is: %s', doc.title);
} catch (err) {
// TODO (developer) - Handle exception from Docs API
console.log('Failed to found document with an error %s', err.message);
}
const doc = Docs.Documents.get(documentId, {'includeTabsContent': true});
console.log(`The title of the doc is: ${doc.title}`);
}
// [END docs_quickstart]

0 comments on commit 3a18325

Please sign in to comment.