Empty CSV File With Header Row
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 02:24 PM
I have a need to write an “empty” CSV file that includes only the header row information in the case that there’s no data to populate the file. Does anyone know a good way to do this? Anything to do with the CSV formatter and the header row options doesn’t seem to be working out. It’s always writing a row of data with blanks for each element separated by the delimiter. Appreciate any thoughts, thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 02:42 PM
I was just looking at this oddly enough. It is a simple POC I built for another team. The issue was that, sometimes, the object was not updated in Salesforce since the last run and returned null. So, uncheck “Ignore Empty Result” in the Salesforce Read, make sure the Mapper is Null Safe, and have the Router look for your key value. If it finds it, carry on as normal. If it does not, parse the object keys and write with the constant as I posted prior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 02:59 PM
Mine looks a bit different. I left outer join my input stream with my static header row and evaluate for the presence of data in my router. Then I either remove the unnecessary header data element or map the header row data to the variable name expected downstream for the data, and union back together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2021 03:01 PM
I have a lot of stuff going on downstream to also add a single column “end of file” footer row, which was also a real pain in the butt.
