Expand my Community achievements bar.

SOLVED

Uploading CSV with Array Field in AEP

Avatar

Level 4

Hi,

 

I am trying to upload a CSV in AEP Customer Data Platform - having 3 fields, Email, Product_Key and Update_Timestamp.

The Field - Product_Key is an Array Field as shown below for reference. 

I have created Schema and Datasets for the required upload and ingesting the data by mapping to target fields. But somehow AEP is not reading the Array properly. Is the below mentioned Array format readable in AEP? Or do I need to create a Calculated Field while mapping the CSV fields to Target Schema?

Please suggest.

 

Thanks.

 

mansibedi_0-1679054391892.png

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

It has nothing to do with AEP.  The CSV files structure does not support Arrays.  If you look in your key column, you see you have a comma in the field value.  That for a CSV file is interpreted as a field delimiter.

While I recommend using a JSON file instead, if you have no other option, you need to pass in multiple fields an create a calculated field to build it on the fly using a combination of data prep functions. https://experienceleague.adobe.com/docs/experience-platform/data-prep/functions.html%3Flang%3Dsv#obj...

 

Specifically I'd consider:

to_object

to_array

str_to_object

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

It has nothing to do with AEP.  The CSV files structure does not support Arrays.  If you look in your key column, you see you have a comma in the field value.  That for a CSV file is interpreted as a field delimiter.

While I recommend using a JSON file instead, if you have no other option, you need to pass in multiple fields an create a calculated field to build it on the fly using a combination of data prep functions. https://experienceleague.adobe.com/docs/experience-platform/data-prep/functions.html%3Flang%3Dsv#obj...

 

Specifically I'd consider:

to_object

to_array

str_to_object

Avatar

Level 4

Thank you! That's really helpful.

I believe I have to use CSV file for now. Can you suggest for the above example in the screenshot, what will be the accurate Syntax and example for the same? 

I looked into the document that you shared but needed some help on how to convert the above array in SS specifically.

 

Thank you!

Avatar

Level 3

You can use split to achieve what you need. 

Hi,


I tested and it seems to be working.

 

For a csv structured like this:

 

user_id,plan_id,costs
12345,123|234,1|2

For example, you can split costs via split(costs,"|").
 
Then you can use a mapping like this details[*]cost