AdsApp.​BulkUploads

Access to bulk uploads:FileUpload,CsvUpload.

Methods:

MemberTypeDescription
newCsvUploadAdsApp.CsvUploadCreates aCsvUpload with the givencolumn headers.
newFileUploadAdsApp.FileUploadCreates aFileUpload with the givenGoogle Sheet.
newFileUploadAdsApp.FileUploadCreates aFileUpload with the contentin the given File in Drive.
newFileUploadAdsApp.FileUploadCreates aFileUpload with the contentin the given Blob.

newCsvUpload(columnNames, optArgs)

Creates aCsvUpload with the givencolumn headers.

This method accepts an optional arguments object. The following optionalarguments are supported:

NameTypeDescription
fileLocaleString File locale, specified in ISO format. Affects how numbers and dates are parsed. Defaults toen_US. See a full list in Supported Locales.
moneyInMicrosboolean Whether or not to represent money in micros ('1370000') or in currency ('1.37'). Defaults totrue.
timeZoneString The time zone to use for dates. No default. The following formats are supported:
  • A timezone in tz database (e.g. America/Los_Angeles etc.). See a full list inList of tz database time zones;
  • Standard offsets in the form[+-]hhmm (e.g. +0800, -0500).
NOTE: this field is required for offline conversion uploads.

Example usages:

//CreatesaCsvUploadwith3columnsnamed'columnA','columnB'and//'columnC',respectively.varupload1=AdsApp.bulkUploads().newCsvUpload(['columnA','columnB','columnC']);//CreatesaCsvUploadwhichrepresentsmoneyincurrency(e.g.1.37)//insteadofinmicros(e.g.137000).varupload2=AdsApp.bulkUploads().newCsvUpload(['columnA','columnB','columnC'],{moneyInMicros:false});

Arguments:

NameTypeDescription
columnNamesString[]The names of column headers.
optArgsObjectOptional arguments.

Return values:

TypeDescription
AdsApp.CsvUploadA CSV Bulk Upload with the given column headers, ready to have data appended.

newFileUpload(sheet, optArgs)

Creates aFileUpload with the givenGoogle Sheet.

This method accepts an optional arguments object. The following optionalarguments are supported:

NameTypeDescription
fileLocaleString File locale, specified in ISO format. Affects how numbers and dates are parsed. Defaults toen_US. See a full list in Supported Locales.
moneyInMicrosboolean Whether or not to represent money in micros ('1370000') or in currency ('1.37'). Defaults totrue.
timeZoneString The time zone to use for dates. No default. The following formats are supported:
  • A timezone in tz database (e.g. America/Los_Angeles etc.). See a full list inList of tz database time zones;
  • Standard offsets in the form[+-]hhmm (e.g. +0800, -0500).
NOTE: this field is required for offline conversion uploads.

Arguments:

NameTypeDescription
sheetSpreadsheetApp.SheetThe Sheet in Google Spreadsheet to be uploaded.
optArgsObjectOptional arguments.

Return values:

TypeDescription
AdsApp.FileUploadA Bulk Upload with the content in the given Google Sheet.

newFileUpload(file, optArgs)

Creates aFileUpload with the contentin the given File in Drive.

This method only accepts files in supported formats (.csv, .tsv, .xls,.xlsx).

This method accepts an optional arguments object. The following optionalarguments are supported:

NameTypeDescription
fileLocaleString File locale, specified in ISO format. Affects how numbers and dates are parsed. Defaults toen_US. See a full list in Supported Locales.
moneyInMicrosboolean Whether or not to represent money in micros ('1370000') or in currency ('1.37'). Defaults totrue.
timeZoneString The time zone to use for dates. No default. The following formats are supported:
  • A timezone in tz database (e.g. America/Los_Angeles etc.). See a full list inList of tz database time zones;
  • Standard offsets in the form[+-]hhmm (e.g. +0800, -0500).
NOTE: this field is required for offline conversion uploads.

Example usages:

//CreatesaBulkuploadfroman.xlsfileunderthegivenDrivefolder.varfiles=DriveApp.getFolderById("folder_id").getFilesByType(MimeType.MICROSOFT_EXCEL);if(files.hasNext()){varfile=files.next();varupload=AdsApp.bulkUploads().newFileUpload(file);}

Arguments:

NameTypeDescription
fileDriveApp.FileThe File in Drive to be uploaded.
optArgsObjectOptional arguments.

Return values:

TypeDescription
AdsApp.FileUploadA Bulk Upload with the content in the given File in Drive.

newFileUpload(blob, optArgs)

Creates aFileUpload with the contentin the given Blob.

This method only accepts Blobs with supported MIME types(CSV,MICROSOFT_EXCEL,MICROSOFT_EXCEL_LEGACY).

This method accepts an optional arguments object. The following optionalarguments are supported:

NameTypeDescription
fileLocaleString File locale, specified in ISO format. Affects how numbers and dates are parsed. Defaults toen_US. See a full list in Supported Locales.
moneyInMicrosboolean Whether or not to represent money in micros ('1370000') or in currency ('1.37'). Defaults totrue.
timeZoneString The time zone to use for dates. No default. The following formats are supported:
  • A timezone in tz database (e.g. America/Los_Angeles etc.). See a full list inList of tz database time zones;
  • Standard offsets in the form[+-]hhmm (e.g. +0800, -0500).
NOTE: this field is required for offline conversion uploads.

Example usages:

//Createsabulkuploadwiththecontentfetchedfromurl.varurl="www.example.com/content.csv";varblob=UrlFetchApp.fetch(url).getAs(MimeType.CSV);varupload=AdsApp.bulkUploads().newFileUpload(blob);

Arguments:

NameTypeDescription
blobBlob.BlobThe Blob in Drive to be uploaded.
optArgsObjectOptional arguments.

Return values:

TypeDescription
AdsApp.FileUploadA Bulk Upload with the content in the given Blob in Drive.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-11 UTC.