AnsweredAssumed Answered

CSV to JSON subarray mapping

Question asked by keane.peterson395338 on Aug 27, 2018
Latest reply on Aug 27, 2018 by rcasimina462530

I'm working through a CSV to JSON mapping, and am struggling with how to map to an array embedded within a parent array. 


The JSON takes the structure below, and it's specifically the "Codes" sub-array that I'm trying to populate with up to 4 values through a mapping. When I import that example as a JSON profile, the Codes attribute is treated as a repeating array element, but the 4 comma-separated codes are considered to be a simple "ArrayElement1" element. Since I can't map 4 CSV elements to the single JSON element, I'm trying to work out a way to manipulate the data and output it in the right format.


JSON profile

I've played around with a few custom map functions, including string concatenating all of the codes together and using "," delimiters, and then performing string replacements when I get unexpected backslashes showing up. I've tried using string prepends and appends to get the double quote and comma-separated formatting right. But I haven't found anything that's worked. And I'm wondering if I'm going to have to alter the JSON profile to reflect how that subarray is formatted.


Anyone dealt with this?