You are here:
Configure a Data Extension to Store a Data Action Payload
If you’re using a Marketing Cloud Engagement data action target to enrich a data action, configure a data extension to store the data action payload.
- Create a data extension with two attributes: one for storing the subscriber key, and the
other for storing the nested JSON payload.
- Subscriber key
- Name: Match the Data Cloud object’s field API name
- Data Type: Match the Data Cloud object’s field data type
- Nested JSON payload
- Name: Match the Data Cloud data graph API name
- Data Type: Text
- Length: Up to 4000 characters (the length can vary based on your output payload and the number of supported characters in Marketing Cloud.)
- Subscriber key
- For both attributes, select Nullable and leave Default
Value empty.After creating the data extension, parse the data graph data from the attribute using a supported scripting language in Email Studio.
%%[
SET @NESTEDDG = Concat('[', AttributeValue("WebinarDataGraph"), ']')
/* Extract root level fields */
SET @RS = BuildRowsetFromJson(@NESTEDDG, '$.[*]', 1)
SET @Row = Row(@RS, 1)
SET @Id__c = Field(@Row, "Id__c")
SET @PersonName__c = Field(@Row, "PersonName__c")
SET @TitleName__c = Field(@Row, "TitleName__c")
SET @LastName__c = Field(@Row, "LastName__c")
/* Extract nested JSON array pzn_UnifiedLoyaltyBalance__cio */
SET @LoyaltyArray = BuildRowsetFromJson(@NESTEDDG, '$.[*].pzn_UnifiedLoyaltyBalance__cio[*]', 1)
SET @LoyaltyArrayRow = Row(@LoyaltyArray, 1)
SET @totalpoints__c = Field(@LoyaltyArrayRow, "totalpoints__c")
SET @unifiedindividualid__c = Field(@LoyaltyArrayRow, "unifiedindividualid__c")
]%%
