Outbound Macro Examples outbound-macro-examples

Examples of how some of the common macros are used to create outbound file templates.

NOTE
In the tables, boldface type identifies each macro with its related output. For the format examples, the < > symbols have been added to help visually separate each macro.

File Name Macros file-name-macros

For a list of available macros and definitions, see Outbound Template Macros.

Macro
Format and Output Examples
DPID

Format: <SYNC_TYPE>_<ORDER_ID>_ <DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_215_ 888_iter_1449756724.sync

MASTER_DPID

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_ <MASTER_DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_215_888_ 20915_iter_1449756724.sync

ORDER_ID

Format: <SYNC_TYPE>_ <ORDER_ID>_<DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_ 215_888_iter_1449756724.sync

SYNC_MODE

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_ <SYNC_MODE>_<TIMESTAMP>.sync

Output:

  • Full: ftp_215_888_ full_1449756724.sync
  • Incremental: ftp_215_888_ iter_1449756724.sync
SYNC_TYPE

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output:

  • FTP: ftp_215_888_iter_1449756724.sync
  • https: http_215_888_iter_1449756724.sync
  • S3: s3_215_888_iter_1449756724.sync
TIMESTAMP

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_<SYNC_MODE>_ <TIMESTAMP>_<admin><.sync>

Output: ftp_215_888_iter_ 1449756724.sync

Header Row Macros header-macros

For a list of available macros and definitions, see Outbound Template Macros.

Macro
Format and Output Examples
TAB

Format: <ORDER_ID> <TAB><SYNC_TYPE>

Output: 888 full.sync

In the output, the non-printing tab character separates each element.

File Content Macros file-content-macros

For a list of available macros and definitions, see Outbound Template Macros.

Macro
Format and Output Examples
DP_UUID

Format: <DP_UUID><TAB> <UUID>

Output: 123456 07955261652886032950143702505894272138

DP_UUID_LIST

Format: <UUID><TAB> <DP_UUID_LIST;separator=TAB>

Output: 07955261652886032950143702505894272138 DP_UUID1 DP_UUID2 DP_UUID3

DPUUIDS
See the separate section below.
REMOVED_SEGMENT_LIST

Format: <DP_UUID> <REMOVED_SEGMENT_LIST;separator=" ">

Output: 123456 105955 101183 101180 101179

SEGMENT_LIST

Format: <DP_UUID> <SEGMENT_LIST;separator=" ">

Output: 123456 105955 101183 101180 101179

if(SEGMENT_LIST && REMOVED_SEGMENT_LIST)endif

Format:

{"AdvertiserId":"<PIDALIAS>", "DataCenterId": 2,"TDID":"<DP_UUID>", "Data":[<SEGMENT_LIST:{seg|<OPEN_CURLY_BRACKET>"Name":"<seg.alias>"<CLOSE_CURLY_BRACKET>}; separator=","><if(SEGMENT_LIST && REMOVED_SEGMENT_LIST)><COMMA><endif> <REMOVED_SEGMENT_LIST:{seg|<OPEN_CURLY_BRACKET>"Name":"<seg.alias>", "TtlInMinutes":0<CLOSE_CURLY_BRACKET>}; separator=",">]}

Output:

//First example {"AdvertiserId":"12345", "DataCenterId": 2, "TDID":"dfd215e4-8d6b-4fdb-90b9-fab4456f2c9d","Data":[{"Name":"4321"}]} //Second example {"AdvertiserId":"12345", "DataCenterId": 2,"TDID":"9099e8fe-abab-5114-abaa-28bdaa0539ca","Data":[{"Name":"4321"},{"Name":"987","TtlInMinutes":0}, {"Name":"654","TtlInMinutes":0}]}

Note: In the first example, the macro only returns data for SEGMENT_LIST because REMOVED_SEGMENT_LIST is empty. The second example returns data for both macros.

SET_ATTRIBUTES

Format:

<PID><TAB><UUID><TAB><DP_UUID><TAB> <SET_ATTRIBUTES><TAB><OPT_OUT><TAB><SEGMENT_LIST:{seg|<seg.type>,<seg.alias>,<OUTPUT_ATTRIBUTE_VALUE>,<seg.lastUpdateTime>&}>

Output:

1159 00088008579683653741516297509717335000 17t0aj01b120hp 1 0 5,103714,1,1344114661000&5,103713,1,1343250661000

TAB

Format: <DP_UUID><TAB><DP_UUID_LIST;separator=TAB>

Output: 123456 UUID1 UUID2 UUID3

In the output, the non-printing tab character separates each element.

TRAIT_LIST

Format: <PID><TAB><DP_UUID><TAB><SET_ATTRIBUTES><TAB> <TRAIT_LIST;separator="|">

Output: 1131 12345 1 123|456|789

DPUUID Examples

To help you understand how the DPUUID macro outputs data, lets assume we have 2 DPIDs mapped to DPUUIDs as shown below:

  • DPID 1111 maps to DPUUIDs AAAA (timestamp = 1) and BBBB (timestamp = 2).
  • DPID 2222 maps to DPUUID CCCC.

Given these conditions, the following table enumerates some possible format strings and their output.

Mapping Condition
Macro Format
Output
Return all mappings for a single DPID
<DPUUIDS; format="dpids=1111|maxMappings=0|format=json">
[["1111","AAAA"],["1111","BBBB"]]
Return a maximum of 1 mapping for all DPIDs
<DPUUIDS; format="dpids=1111,2222|maxMappings=1|format=json">

[["1111","BBBB"],["2222","CCCC"]]

For DPID 1111 , the macro maps to DPUUID BBBB only because that ID has the larger timestamp.

Return a maximum of 2 mappings for a single DPID
<DPUUIDS; format="dpids=2222|maxMappings=2|format=json">

[["2222","CCCC"]]

Even though maxMappings=2 , this macro returns only 1 DPID to DPUUID mapping because the specified DPID has only one DPUUID.

Outbound Template Macros

recommendation-more-help
de293fbf-b489-49b0-8daa-51ed303af695