Using placeholders

This article explains how to use placeholders to name files and tables.

Introduction

Use placeholders to create dynamic names for objects such as data tables or files during a Data Extract transfer. Placeholders use the metadata from a Data Extract. Only certain fields allow the use of placeholders, for example, they can be used to name a table created in a database Destination during a Data Extract transfer.

Placeholders do not rename existing files in Adverity, instead, they are used to create names for objects found in external Destinations.

Use unique, dynamic names to prevent data from being overwritten in the Destination. Using static or hard-coded names may result in data being overwritten.

Viewing available metadata

The {meta[*]} placeholder requires metadata from a Data Extract. To view the list of metadata available for use in this placeholder, follow these steps:

  1. Click the Connect element and select the Workspace you work with in Connect, Enrich & Transfer.

  1. In the middle of the page, in the All tasks tab, find the task with the metadata you want to view, and click Show extracts.

  2. In the list, find the Data Extract with the metadata you want to view, and click the hyperlinked element.

  3. At the top of the page, click Metadata.

Adverity displays a list of metadata specific to that Data Extract in the middle of the page. The values in the left column can be used within the {meta[*]} placeholder.

The list of metadata values varies slightly depending on the type of Datastream from which the data has been fetched. However, many metadata values are common to all Data Extracts. A list of these common metadata values is shown in the Table of common metadata values.

Creating names with placeholders

Use placeholders in an applicable field to create dynamic names for objects such as:

  • File names for transfers to Destination types of files or datalakes.

  • Table names for external databases.

Static or hard-coded names may result in data from being overwritten. Dynamic names prevent data being overwritten due to the creation of a unique name.

See the example below for how to create a dynamic name with the {scheduled_year} and {extract_id} placeholders.

  1. Click the Transfer element and select the Workspace you work with in Connect, Enrich & Transfer.

  1. Click the Destination in which you want to create a dynamic name.

  2. Find the relevant field that allows placeholders. Such fields can be found in the following locations:

    • For file or datalake Destinations (such as File OneDrive), click File Format, the File Name Template field allows the use of placeholders.

    • For database Destinations (such as Azure Synapse), under Configuration, the Table Name Template field allows the use of placeholders.

    • For most Destinations, in Datastream Mappings, the fields within the Table name or File name column allow the use of placeholders.

  3. In the relevant field, combine the placeholders {scheduled_year} and {extract_id} together as {scheduled_year}_{extract_id}.

This creates a dynamic name similar to 2021_12345. In this example, 2021 is the year on which the Data Extract took place and 12345 is the Data Extract ID.

Creating names with the meta placeholder

The placeholder {meta[*]} uses metadata from a Data Extract, where the * represents an item of metadata. When using the {meta[*]} placeholder, replace * with an item of metadata found in a Data Extract.

To find an item of metadata, follow the steps outlined in Viewing available metadata.

See the example below for how to use the {meta[*]} placeholder with the metadata value Datastream display name to create a dynamic name.

  1. Click the Transfer element and select the Workspace you work with in Connect, Enrich & Transfer.

  1. Click the Destination in which you want to create a dynamic name.

  2. In the relevant name field that allows placeholders, enter the placeholder {meta[*]}.

  3. Replace * with datastream_display_name, so the placeholder becomes {meta[datastream_display_name]}.

The name is created using the datastream_display_name from the metadata of the Data Extract.

For example, the metadata item datastream_display_name for a Facebook Ads Insight Data Extract is Facebook Ads Insight. Therefore, the placeholder of {meta[datastream_display_name]}_{extract_id} would create the name Facebook Ads Insight_12345.

Table of common metadata values

The metadata of a Data Extract contains a series of information unique to that Data Extract. This metadata is available to use within the {meta[*]} placeholder.

The list does not contain all possible metadata values, as the list varies depending on the type of Datastream. Instead, this table lists the most common metadata values.

Metadata value

Description

Example

adverity_datatap_version

Version number of Adverity at the time of the Data Extract.

2021.12.0.3

custom_meta_information

Additional, source specific information, most commonly used in file-based Connectors.

{'source_directory': None, 'source_encoding': 'utf-8', 'source_filename': 'Basic ScriptingTable.xlsx.gz'}

datastream_URI

Uniform Resource Identifier (URI) of the Datastream

anon.datatap.adverity.com/ads_insights/123/facebook-ads-10/

datastream_callback_URL

URL of the Datastream. This is a hyperlink to the Datastream page.

https://anon.datatap.adverity.com/ads_insights/123/facebook-ads-10/

datastream_display_name

Name of the Datastream.

Facebook Ads 10

datastream_extract_URI

Uniform Resource Identifier (URI) of the Data Extract preview file.

anon.datatap.adverity.com/ads_insights/123/facebook-ads-10/ads_insights-123-20210301-a724a297e86dfd5d2db077ea35201723.csv/

datastream_extract_callback_URL

URL of the Data Extract preview file. This is a hyperlink to the Data Extract preview.

https://anon.datatap.adverity.com/ads_insights/123/facebook-ads-10/ads_insights-123-20210301-a724a297e86dfd5d2db077ea35201723.csv/

datastream_extract_column_count

Number of columns within the Data Extract.

50

datastream_extract_created

Date and time on which the Data Extract took place.

2021-03-01 09:48:53

datastream_extract_datepattern

Format of the date.

yyyy-MM-dd

datastream_extract_display_name

Display name of the Data Extract.

Facebook Ads 10 - 2021-03-01

datastream_extract_id

ID of the Data Extract.

2886

datastream_extract_is_empty

True/False flag to indicate if a Data Extract is empty.

False

datastream_extract_mapping

Overview of the Datastream Mapping applied to the Data Extract.

{'account_id': 'column': 'advertiser_id', 'type': 'string'}

datastream_extract_range_end

End date of the date range of the Data Extract.

2021-02-28 23:59:59

datastream_extract_range_start

Start date of the date range of the Data Extract.

2021-02-01 00:00:00

datastream_extract_row_count

Number of rows within the Data Extract.

560

datastream_extract_scheduled

Date and time on which a Data Extract was scheduled to run.

2021-03-01 08:00:00

datastream_extract_updated

Date and time on which a Data Extract was updated.

2021-03-01 09:48:53

datastream_id

ID of the Datastream.

4321

datastream_overwrite_options

List of clauses that determine if a Data Extract should overwrite existing data within the Destination.

{'dimensions': [], 'on_duplicate_filename': False, 'on_matched_date_range': True, 'same_data_stream': True}

datastream_type_display_name

Display name of the Datastream.

Facebook Ads Insights

datastream_use_datatap_endpoint

True/False flag to indicate if the Data Extract Destination is within Adverity.

True

datatap_job_uuid

Universally unique identifier (UUID) of the Datastream task associated with the Data Extract.

49e872cc-1912-4262-9192-e5d7000b761d

extract_date

Date on which the Data Extract took place.

2021-03-01

managed_name

True/False flag to indicate if Unique by day has been selected in the Extract Filenames field. This option is found in the Local Data Retention section of the Datastream configuration. For more information, see Configuring advanced Datastream settings.

True