0

I am passing one or more than one product through API call ([https://www.exacttargetapis.com/interaction/v1/events][1]) in the same Data Extension's field (using ~ tilde as separator). This is the example of the API call

{
   "contactKey":"12343546"",
   "eventDefinitionKey":"ContactEvent-840dfcfe-d8f0-387a-52a4457aa06f",
   "EstablishContactKey": false,
   "data":{
        "EmailAddress":"roberto.test@test.com",
        "SubscriberKey":"12343546",
        "AbandonedCartID" : "9218921" ,
        "NumberOfItems" : "4" ,
        "SkuID" : "1076847~1076848" ,
        "Price" : "150.00~70.34",
        "Quantity" : "1~3",
        "IsConverted" : false,
        "CartTotal": "210.34"        
   }
}

I would like to understand how retrieve SkuIDs of the products in HTML email content using AMPSCRIPT. I noticed that if i want to pass multiple values i should set 'Text' as data type of the fields (Quantity, Price, SkuID). Do you confirm that is the standard way to handle them?

Do you think is possible to use BuildRowsetFromString("150.00~70.34", "~") ?

0

Yes, it is possible to use BuildRowsetFromString("150.00~70.34", "~") in this scenerio.

ampscript

%%[
var @rowSet
set @rowSet = BuildRowsetFromString("150.00~70.34", "~") 
for @i = 1 to RowCount(@rowSet) do
    set @row = Row(@rowSet, @i)
    set @value = Field(@row,1)
    @value = Field(Row(@rowSet, @i),1)
    output(concat("<div>", @value,"</div>"))
next @i
]%%

results

150.00
70.34

The data extension field must have a data type of text because the tilde is stored in the data extension field and is not considered numeric. Also, be sure to assign a field width that is large enough to store all the data being passed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.