Forum Discussion
Hi, I was not able to find the xml attachments you list but I think I had the same issue where the were sub-fields under my ‘address’ had multiple sub-records but only if there was data in each. Example being one might only have address1 while the next would have that and address2. I had to break this out after the JSON Splitter in the Mapping snap. Then in each field I had to use the hasOwnProperty function and some ternary logic:
$.hasOwnProperty(‘address.address1’) ? $.address.address1 : null
$.hasOwnProperty(‘address.address2’) ? $.address.address2 : null
$.hasOwnProperty(‘address.city’) ? $.address.city : null
etc…
I also had to create the data table with all the possible fields to match for the mapping.
Here is the URL to this function
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439367/Object+Functions+and+Properties#ObjectFunctionsandProperties-hasOwnProperty
Below is a screen shot of my mapping: Hope my upload worked. First time contributing.