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.
- Ajay_Chawda5 years agoContributor
Hi jervin,
Please uncheck “Contains Headers” check box and set skip line =1 (assuming first line of file contains header information )
Please find the attachment for sample pipeline and row file which used as input or sample pipeline.
Regards,
Ajay
name.txt (51 Bytes) testCSVHeader_2021_02_03 (1).slp (3.9 KB)
Related Content
- 3 years ago
- 3 years ago
- 4 months ago
- 10 months ago