Destination SDK中支援的轉換函式
Experience PlatformDestination SDK使用 Pebble 範本,可將從Experience Platform匯出的資料轉換為目的地所需的格式。
Experience Platform Pebble 與提供的現成可用版本相比,實作有一些變更 Pebble. 此外,除了提供的現成可用函式以外, Pebble,Adobe已建立一些可與Destination SDK搭配使用的其他函式。
使用位置 where-to-use
使用本頁面下方所列的支援函式,當 建立訊息轉換範本 適用於從Experience Platform匯出至目的地的資料。
訊息轉換範本用於 目的地伺服器設定 適用於串流目的地。
先決條件 prerequisites
若要瞭解本參考頁面中的概念和函式,請閱讀 訊息格式 檔案優先。 您需要瞭解 設定檔的結構 Experience Platform中,然後才能使用 Pebble 範本以轉換及匯出的資料。
繼續進行下面記錄的功能之前,請檢閱一節中的範本化範例 使用範本語言進行身分、屬性和對象成員資格轉換. 這裡的範例一開始非常簡單,複雜性也增加了。
支援 Pebble 函式 supported-functions
從 Pebble 標籤區段,Destination SDK僅支援:
for
反複處理時不同 陣列 或 地圖 範本中的元素。 當反複處理陣列時,可以直接取得元素。 當反複檢視對映時,會取得每個對映專案,每個對映專案都有一個索引鍵/值組。- 如需陣列元素的範例,請思考陣列元素中的身分 identityMap 名稱空間,您可以在此處循環檢視元素,例如
identityMap.gaid
,identityMap.email
或類似專案。 - 如需對應元素的範例,請考慮 區段會籍.
從 Pebble 篩選區段,Destination SDK支援所有函式。 以下進一步的範例說明如何 date
函式可在Destination SDK中使用。
從 Pebble 函式區段,Adobe會 非 支援 範圍 函式。
範例: date
函式使用中 date-function
以示範 Pebble 函式用於Destination SDK,請參閱下面的日期函式(Pebble檔案中的連結)來轉換時間戳記的格式。
使用案例
您想要變更 lastQualificationTime
來自預設值的時間戳記 ISO 8601 Experience Platform會匯出至目的地偏好之其他值的值。
範例
輸入
{
"lastQualificationTime": "2022-02-08T18:34:24.000+0000"
}
格式
{{ lastQualificationTime | date(existingFormat="yyyy-MM-dd'T'HH:mm:sss.SSSX", format="yyyy-MM-dd'T'HH:mm:ssX") }}
輸出
{
"lastQualificationTime": "2022-02-21T18:34:24Z"
}
Adobe新增的函式 functions-added-by-adobe
除了提供的現成可用函式之外, Pebble,請參閱下方的Adobe建立的其他函式,這些函式可用於資料匯出。
addedSegments
和 removedSegments
函式 addedsegments-removedsegments-functions
使用案例
這些函式可用於取得新增到設定檔或從中移除的對象清單。
範例
輸入
{
"identityMap": {
"myIdNamespace": [
{
"id": "external_id1"
},
{
"id": "external_id2"
}
]
},
"segmentMembership": {
"ups": {
"111111": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "realized"
},
"222222": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "exited"
},
"333333": {
"lastQualificationTime": "2019-11-20T13:15:49Z",
"status": "realized"
}
}
}
}
格式
added: {% for s in addedSegments(segmentMembership.ups) %}<{{s.key}}>{% endfor %}; removed: {% for s in removedSegments(segmentMembership.ups) %}<{{s.key}}>{% endfor %}
輸出
added: <111111><333333>; removed: <222222>
後續步驟 next-steps
您現在知道是哪個 Pebble Destination SDK支援函式,以及如何使用它們調整匯出資料的格式以符合您的需求。 接下來,請檢閱下列頁面: