Add attachments to email

Hi,
I want to add a few xml files as attachements when sending an email but I can’t figure out what to add in the email setup as Attachement. It says it needs to be “file record or table of file records”. I then tried to create a file records using the following, but then what is expected as “data” here?

let fileRec = [filename: ‘reports.xml’, data: textOutput ];
return fileRec;

Unfortunately there is no flow script function yet for converting data to binary so recommended approach for now is to step over a DB connector and convert it to binary using SQL Functions (e.g. convert varbinary(max))

Hi,

when i need to create attachement files from Flow i usualy use Filesystem connector to write text (or lines) to some file, then zip that file, and then zip to stream. That stream can then be used in data column of my attachements table.

If its a cloud flow server then d:\home\site\wwwroot\ will do as a location to create the file and zip.
Just make sure you clean up after :slight_smile:

Example here: Test file to mail

Hope this helps!

B R
Ivan

Hi Ivan, that really interests me to see the sample flow. Can you reset that link or supply a new one? When I click it it says it’s expired.

Thanks,

Michael

Hi Michael,
sorry for the late reply but here is another link: Sign in to your account
I cant stop it from expiring but it should be there until July.

B R
Ivan