Hi,
I am trying to ingest a delimiter(space) separated string from a CSV file to an array field in AEP by using "split" data prep function. Below are input string and data prep function I am using.
Using data prep function the data that gets inserted is an error text " [Ljava.lang.String;@59c1a063}" and not the split values from the string.
Can anyone please suggest what could be possible issue here and how to resolve this. I tried using a statis string in data prep split function but getting the same error in schema filed value.
Input String in CSV: 'c1 c2 c3 c4'
customerId | categoryNames |
1001 | c1 c2 c3 c4 |
1002 | c1 c2 |
1003 | c1 c2 c3 |
split function code -> split(categoryNames, " ")
Split function preview
Filed value with error
https://experienceleague.adobe.com/docs/experience-platform/data-prep/home.html?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Sneha-Parmar ,
In my test setup, the "categoryname" field is set up as an Array of String.
When you're mapping data in the dataflow, it automatically points to the first item (index 0) in the array. So, when you're mapping data to an array field, you don't need to specify indices.
To resolve the problem, please remove the [0] index when mapping, and then try to ingest the data again as I mentioned in my earlier message.
Krishna
Hi @Sneha-Parmar ,
Regards,
Krishna Gupta
Views
Replies
Total Likes
Hi @Krish829 ,
I tried above mapper function as well but same error as before. Also I see in your data mapping above you have mapped input list category name filed to a String filed which is not the case. My schema filed is of type string and marked as an array. Please see below. Please let me know if there is a workaround when the schema filed is a String Array and not simple String.
Thanks
Views
Replies
Total Likes
Hi @Sneha-Parmar ,
In my test setup, the "categoryname" field is set up as an Array of String.
When you're mapping data in the dataflow, it automatically points to the first item (index 0) in the array. So, when you're mapping data to an array field, you don't need to specify indices.
To resolve the problem, please remove the [0] index when mapping, and then try to ingest the data again as I mentioned in my earlier message.
Krishna
Thankyou @Krish829 for all your inputs. The solution worked. The problem was that I was not removing "[0]" while mapping source to destination fields and hence getting error in data value. Thanks again for your help !
Views
Replies
Total Likes
Hi @Krish829 ,
Need one more help on arrays, Have you tried share an array filed to any destination while segment activation. How does filed value appear at destination end? Can those be extracted index wise or it appear as string?
Thanks again !
Views
Replies
Total Likes
Hi @Sneha-Parmar ,
During Segment Activation, you can't directly match an array-type source field with the destination, but you can send individual items from the source array to the destination based on their index. For example:
Source: xdm:<<tenantId>>.categoryname[i]
Where "i" can be 0, 1, 2, and so on.
Alternatively, you can activate dataset to share array field. And the format at destination would be
"categoryname" : ["c1","c2","c3"] in a JSON file.
Krishna
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies