Question

Setting a dynamic Destination Fanout Directory

  • 19 January 2024
  • 2 replies
  • 27 views

Badge +2

Hi all,

 

I have a dataset that contains a _dirpath attribute that I would like to use as the Destination Fanout Directory. My workflow injests CSVs from multiple different folders, and I would like to output the Writer data to the same folder that the data originally came from. Does anyone know if that is possible? I can't seem to set an attribute as an input for the Destination Fanout Directory. Any suggestions?


2 replies

Userlevel 4
Badge +17

If you use a FeatureWriter you can set your _dirpath attribute as Dataset and maybe create a _filename attribute to use as CSV File Name (Im guessing you are writing to CSV). The _filename.csv file will be written in the _dirpath directory.

imageYou might have to play around with the other parameters of the FeatureWriter to get it to correctly append/insert/truncate your data.

Badge +2

If you use a FeatureWriter you can set your _dirpath attribute as Dataset and maybe create a _filename attribute to use as CSV File Name (Im guessing you are writing to CSV). The _filename.csv file will be written in the _dirpath directory.

imageYou might have to play around with the other parameters of the FeatureWriter to get it to correctly append/insert/truncate your data.

Hi there, thanks for this tip! This got me going in the correct direction. I did a little attribute work up front to create a full path name [basically: @Value(_dirpath)@Value(_rootname)_checkResults_@DateTimeFormat(@DateTimeNow(), %Y%m%d_%I%M%p).xlsx] then set that attribute as the Dataset, and was on my way. everything was posted exactly as it should in the location I spelled out. Thanks so much!

Reply