Hello! I have a scenario where a Mapper snap is generating 10 fields and producing 5 rows of data. However, in the final CSV output, I need only 7 of the headers to be visible. The remaining 3 headers should not appear in the CSV file, but their corresponding data should still be included in the output. How can I configure the pipeline or the CSV Formatter snap in SnapLogic so that only selected headers appear, while still keeping all data values in the correct order? Any guidance or best practices to achieve this would be appreciated.
you want to create a csv with 7 columns on the header and 10 columns on the data? that's fairly non standard. most consumer would error trying to read this. you could perhaps write the header line first with a row of 7 values which are your 7 headers at the start of the pipeline, then append the data with the csv formatter, without headers. again though, are you sure this is what is required?
I have attached screenshot where it has total 12 fields and 3 rows of data I need first 9 fields headers to appear which is in highlighted in yellow and fields headers of last 3 fields which is highlighted in green should not appear in file. but the data should appear as it has data in last row.
I do not think there is a way to do this with the CSV Formatter, If you specify the 7 Header Fields in the settings it will not write the raining 3 fields into the CSV, otherwise it will write out all fields with headers. My gut feeling says that you might need to convert all your fields into one string in a mapper via $.keys().join(",") and $.values().join(",") and then write that out with a Fixed With Formatter.
Thanks! Ingo
