@@ -25,44 +25,44 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
2525 const { google} = require ( 'googleapis' ) ;
2626
2727 const auth = new GoogleAuth (
28- { scopes : [ 'https://www.googleapis.com/auth/presentations' ,
29- 'https://www.googleapis.com/auth/drive' ,
30- 'https://www.googleapis.com/auth/spreadsheet' ] } ) ;
28+ { scopes : [ 'https://www.googleapis.com/auth/presentations' ,
29+ 'https://www.googleapis.com/auth/drive' ,
30+ 'https://www.googleapis.com/auth/spreadsheet' ] } ) ;
3131
3232 const slidesService = google . slides ( { version : 'v1' , auth} ) ;
3333 const sheetsService = google . sheets ( { version : 'v4' , auth} ) ;
3434 const driveService = google . drive ( { version : 'v2' , auth} ) ;
3535
3636 // Use the Sheets API to load data, one record per row.
37- let responses = [ ] ;
38- let dataRangeNotation = 'Customers!A2:M6' ;
37+ const responses = [ ] ;
38+ const dataRangeNotation = 'Customers!A2:M6' ;
3939
4040 try {
4141 const sheetsResponse = await sheetsService . spreadsheets . values . get ( {
4242 spreadsheetId : dataSpreadsheetId ,
4343 range : dataRangeNotation ,
4444 } ) ;
45- let values = sheetsResponse . data . values ;
45+ const values = sheetsResponse . data . values ;
4646
4747 // For each record, create a new merged presentation.
4848 for ( let i = 0 ; i < values . length ; ++ i ) {
49- let row = values [ i ] ;
50- let customerName = row [ 2 ] ; // name in column 3
51- let caseDescription = row [ 5 ] ; // case description in column 6
52- let totalPortfolio = row [ 11 ] ; // total portfolio in column 12
49+ const row = values [ i ] ;
50+ const customerName = row [ 2 ] ; // name in column 3
51+ const caseDescription = row [ 5 ] ; // case description in column 6
52+ const totalPortfolio = row [ 11 ] ; // total portfolio in column 12
5353
5454 // Duplicate the template presentation using the Drive API.
55- let copyTitle = customerName + ' presentation' ;
55+ const copyTitle = customerName + ' presentation' ;
5656 let requests = {
5757 name : copyTitle ,
5858 } ;
5959
6060 const driveResponse = await driveService . files . copy ( {
6161 fileId : templatePresentationId ,
6262 requests,
63- } ) ;
63+ } ) ;
6464
65- let presentationCopyId = driveResponse . data . id ;
65+ const presentationCopyId = driveResponse . data . id ;
6666 // Create the text merge (replaceAllText) requests for this presentation.
6767 requests = [ {
6868 replaceAllText : {
@@ -96,7 +96,7 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
9696 requests,
9797 } ,
9898 } ) ;
99- let result = batchUpdateResponse . data ;
99+ const result = batchUpdateResponse . data ;
100100 // [START_EXCLUDE silent]
101101 responses . push ( result . replies ) ;
102102 // [END_EXCLUDE]
@@ -117,4 +117,4 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
117117// [END slides_text_merging]
118118
119119textMerging ( '12zc4QWOtsJZ0weX3zFHj5O_IVRhXQYqOXjbia4hoXw4' ,
120- '1uSTAkV11mnou78uRdTYcy36owjZR2mWMDAeRhXEImjE' ) ;
120+ '1uSTAkV11mnou78uRdTYcy36owjZR2mWMDAeRhXEImjE' ) ;
0 commit comments