Question

Emailer transformer with attachment dynamic filename


Hello,

I've created a process that executes a SQL query that I export

in a CSV file with a dynamic filename. "CANCEL_" + date of execution + ".csv"

 

That part works fine.

 

But I want to send the file by email with the transformer EMAILER.

 

I can't figure out how to manage the dynamic filename. Everything I tried fail :(

 

I've put the filename directly in the SQL query with the field name "fichier", that I retrieve in a variable.

 

Any idea?2021-03-02_08h11_032021-03-02_08h10_04my error message

 

2021-03-02_09h30_16Thanks a lot !


2 replies

Userlevel 1
Badge +21

Your workflow has two independent branches which you aren't merging in anyway, so if you are expecting to have one feature hitting the emailer which has data from both branches you are mistaken

Userlevel 6
Badge +32

Your workflow has two independent branches which you aren't merging in anyway, so if you are expecting to have one feature hitting the emailer which has data from both branches you are mistaken

This. There are two features getting to the Emailer and I expect you want one. And the Feature which reaches the Emailer first is the feature from the lower stream.

 

One way to fix this is to replace the FeatureHolder_2 with a FeatureMerger and setting the requestor and supplier both to "1".

 

The other issue is the Emailer wants a complete path to the attachment, not only the filename. You can get this from the FeatureWriter Summary outputport, _dataset, and you need to add the filename to it.

Reply