AdWordsApp.​ExecutionSelector

Fetches executions of either scripts or bulk uploads. Specifying the type of execution is required.

Typical usage:

 var executionSelector = AdWordsApp.executions()
     .withCondition("UploadType = CM_ENTITY")
     .forDateRange("LAST_MONTH");

 // Get the iterator over the executions specified. Note that the type of execution is required.
 var executionIterator = executionSelector.forBulkUploads();  // required
 while (executionIterator.hasNext()) {
   var execution = executionIterator.next();
 }
Related:

Methods:

MemberTypeDescription
forBulkUploads AdWordsApp.ExecutionIterator Fetches the requested executions of type UPLOAD and returns an iterator.
forDateRange AdWordsApp.ExecutionSelector Sets a predefined date range onto the selector.
forDateRange AdWordsApp.ExecutionSelector Sets a custom date range onto the selector.
forScripts AdWordsApp.ExecutionIterator Fetches the requested executions of type SCRIPT and returns an iterator.
withCondition AdWordsApp.ExecutionSelector Adds the specified condition to the selector in order to narrow down the results.
withLimit AdWordsApp.ExecutionSelector Specifies limit for the selector to use.

forBulkUploads()

Fetches the requested executions of type UPLOAD and returns an iterator. Please note that specifying the type of execution is required.

Return values:

TypeDescription
AdWordsApp.ExecutionIterator Iterator of the requested executions with type UPLOAD.

forDateRange(dateRange)

Sets a predefined date range onto the selector. Supported values:

TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK, LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT, THIS_MONTH, LAST_MONTH, ALL_TIME. Example:

 selector.forDateRange("THIS_WEEK_SUN_TODAY");

Date range must be specified if the selector has conditions or ordering for a stat field. Note that only the last date range specified for the selector will take effect.

Arguments:

NameTypeDescription
dateRange String Date range to set onto the selector.

Return values:

TypeDescription
AdWordsApp.ExecutionSelector The selector with date range applied.

forDateRange(dateFrom, dateTo)

Sets a custom date range onto the selector. Both parameters can be either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD form. For instance, March 24th, 2013 is represented as either {year: 2013, month: 3, day: 24} or "20130324". The date range is inclusive on both ends, so forDateRange("20130324", "20130324") sets the range of one day.

Date range must be specified if the selector has conditions or ordering for a stat field. Note that only the last date range specified for the selector will take effect.

Arguments:

NameTypeDescription
dateFrom Object Start date of the date range.
dateTo Object End date of the date range.

Return values:

TypeDescription
AdWordsApp.ExecutionSelector The selector with date range applied.

forScripts()

Fetches the requested executions of type SCRIPT and returns an iterator. Please note that specifying the type of execution is required.

Return values:

TypeDescription
AdWordsApp.ExecutionIterator Iterator of the requested executions with type SCRIPT.

withCondition(condition)

Adds the specified condition to the selector in order to narrow down the results.

Multiple conditions may be added to the same selector:

 selector = selector
     .withCondition("UploadType = 'CM_ENTITY'")
     .withCondition("StartTimeStamp > 1503181658000");
All specified conditions are AND-ed together. The above example will retrieve executions with an uploadType for bulk executions of CM_ENTITY that started after 1503181658000 UTC (Saturday, August 19, 2017 10:27:38 PM UTC).

The parameter to be passed into this method must be of the following form:

 "COLUMN_NAME OPERATOR VALUE"

Operators

The operator that can be used in a condition depends on the type of column.
  • For Integer and Long columns (e.g. StartTimeStamp):
    <  <=  >  >=  =  !=
  • For Enumeration columns (ones that can only take one value from a predefined list, such as Type):
     =  !=  IN []  NOT_IN []
Conditions using IN and NOT_IN operators look as follows:
 withCondition("ColumnName IN [Value1, Value2]")
Operators are case-sensitive: starts_with won't work.

Columns

All column names are case-sensitive, and so are all values of enumerated columns (such as UploadType).

Column Type Example
StartTimeStamp Long withCondition("StartTimeStamp > 1503181658000") The value is the number of milliseconds since the epoch (UTC). Please note that only executions that have finished executing within the last two hours of the current time in UTC can be selected.
UploadType Enumeration: CM_ENTITY, OFFLINE_CONVERSION withCondition(“UploadType = CM_ENTITY”)

Arguments:

NameTypeDescription
condition String Condition to add to the selector.

Return values:

TypeDescription
AdWordsApp.ExecutionSelector The selector with the condition applied.

withLimit(limit)

Specifies limit for the selector to use. For instance, withLimit(50) returns only the first 50 entities.

Arguments:

NameTypeDescription
limit int How many entities to return.

Return values:

TypeDescription
AdWordsApp.ExecutionSelector The selector with limit applied.

Send feedback about...

AdWords scripts
AdWords scripts
Need help? Visit our support page.