โ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.
โ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.
โ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.
โ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.