CreateAudiencesFromWorkbook
  • 2 Minutes to read
  • Dark
    Light
  • PDF

CreateAudiencesFromWorkbook

  • Dark
    Light
  • PDF

Article summary

Reads list of audience IDs and names from excel workbook and creates a series of dataset audiences on primary contact table. Includes the option to export a subset of data as a pivot table.

KeyValue(s)Description
method"CreateAudiencesFromWorkbook"Reads a list of audience IDs and names from excel workbook and creates a series of dataset audiences on primary contact table. Includes the option to export a subset of data as a pivot table.
overwritetrue/falseOptional.  Default = false.
If true, existing audiences (as matched on audience ID) will be overwritten.
If false and audience exists and ignoreExisting is false, an error will be raised.
ignoreExistingtrue/falseOptional.  Default = true.
If true, if a listed audience already exists as a dataset on primary contact table, it will be skipped and not recreated.
If false, if a listed audience already exists as a dataset on primary contact table, if overwrite = true, audience will be recreated.  If overwrite = false, an error will be raised.
filename"PathAndFilename.xlsx"Path and filename to workbook containing the audiences to create.
Note: Workbooks can be auto generated using the ExportIntoWorkbook method.
Workbook should have the format:
  • ID
  • Name
forceValidNamestrue/falseOptional. Default = false
If true, illegal characters will be stripped from fieldnames.
startRowNOptional.  Default = 1
If provided, determines the startrow to read from in workbook "filename"
exportAsTable"PivotTableName"Optional.  Default = ""
If non blank, creates a table of "PivotTableName" that contains datasets for the segments specified in "filename"
additionalExportFields [][
"hash_field"
"..."
]
Optional.  
Used if exporting to table (see exportToTable)
By default, the primary contact key will be included in the newly created pivot table.  To include other fields from the primary contact table, list them here.
applyIdsAsExportFiltertrue/falseOptional.  Default = false.
If true, only records in the primary contact table that are in one or more of the datasets in "filename" will be exported.  If false, the created pivot table will have the same number of records as the primary contact table.
useBitfieldstrue/falseReserved for future use
usePooltrue/falseReserved for future use
dataset [][
dataset definition
]
Optional.  Dataset from the primary contact table.
If true, only records that are in the dataset will be included in the calculated audiences and pivot table.
hasDescriptionColumntrue/falseOptional.  Default = false
If true, will output segment descriptions as a description column in pivot table "exportAsTable", and will attach segment descriptions to datasets on the primary contact table.

Key Terms

  • Primary Contact Table - the DataJet table containing the list of unique integer keys and hash-keys (e.g., SHA256), as generated by ProcessSegments.
  • Audience - equivalent to a segment.   The set of Primary Contact Table records that are present in a particular segment.
  • Pivot Table - DataJet table containing hash-keys (e.g. SHA256) and Audience Datasets.  Multiple pivot tables can be created by calling CreateAudiencesFromWorkbook with different definition files.

Notes

The general approach is:

  1. Call ProcessSegments and CreateTableFromFile to create the Primary Contact Table
  2. Create PivotDefinition file(s) (e.g. "filename") as excel workbooks)
  3. Call CreateAudiencesFromWorkbook with a definition file containing all segment IDs, with overwrite = true
  4. For each required subset of data, call CreateAudiencesFromWorkbook with the following:
    1. exportAsTable = table name
    2. filename = Industry or client specified definition file
    3. overwrite = false
    4. applyIdsAsExportFilter = true
    5. additionalExportFields[]

Note: The Primary Contact Table is defined in the project's campaign definition file.

Sample definition file:

Definition file contains:

  1. Id
  2. segment_code
  3. description

Sample output

Example

{
  "method": "CreateAudiencesFromWorkbook",
  "overwrite": false,
  "ignoreExisting": true,
  "filename": "%DATAPATH%LifeStyle.xlsx",
  "forceValidNames": true,
  "startRow": 2,
  "exportAsTable": "LifeStyle",
  "additionalExportFields": [
    "hash"
  ],
  "applyIdsAsExportFilter": true,
  "useBitfields": true,
  "usePool": true,
  "project": "eyeota-pivot"
}


Error Messages

  • DATA_EYE_FULL.name is not a field
  • Exception of type 'System.Exception' was thrown.
  • failed exporting table


  • field 'DATA_EYE_FULL.SHA_256' does not exist on table


  • Could not find document





Was this article helpful?