Uploading CSV with Array Field in AEP | Community
Skip to main content
Level 3
March 17, 2023
Solved

Uploading CSV with Array Field in AEP

  • March 17, 2023
  • 1 reply
  • 3493 views

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.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Danny-Miller

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#objects

 

Specifically I'd consider:

to_object

to_array

str_to_object

1 reply

Danny-Miller
Adobe Employee
Danny-MillerAdobe EmployeeAccepted solution
Adobe Employee
March 17, 2023

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#objects

 

Specifically I'd consider:

to_object

to_array

str_to_object

mansibediAuthor
Level 3
March 17, 2023

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!

benedikt-buchert
Level 2
July 6, 2023

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