Jump to content

Export multiple .csv files to a single email


This topic is 3152 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Screen_Shot_2015-09-03_at_11.45.44_AM.thScreen_Shot_2015-09-03_at_11.46.23_AM.thHi,

I thought you could append an export file similar to the "Append" when you safe to pdf.  

 

Please see attached script and pop up pics, I've created two "Temporary Paths" .... $Set Temp Path and $Set Temp Path 2 and I added both into the "Send as Email" script step in the "Attach File" pop up.  

 

However, I am only allow the first valid "one" file in the "File Path" window even though both are valid.

 

Is there anyway to get both .csv file into the same email body ??  I'd rather not have two email window pop, one for each export.  Any assistance in this matter I would be grateful.

 

 

Thank you.

Tom

Edited by Snozzles
Link to comment
Share on other sites

Why are you sending them as .CSV files. Are they taking those files and Importing them into anything.

It makes more sense to me to compile a Professional Report with the Payment and Invoice Items present and Save that as a PDF. Then attach the ONE PDF to am email.

Am I missing something?

BTW... I believe FileMaker can only send TEXT Emails and have ONE attachment using the Send Mail script step. Beyond that you might need to research some 3rd party plug-ins.

Link to comment
Share on other sites

You could (using Finder) create a folder somewhere convenient.

Then save your two csvs into that.

Then set the file path as that folder.

That's assuming that you really need CSVs - otherwise dwdatas solution is the way to go.

Cheers,

Mike

Link to comment
Share on other sites

Hi,

Sorry for the delay, I was unable to respond.

DW Data: Yes ... if the customer is requesting a "Report" I do that ... provide the result in a pdf.  Agreed, however ...

The cvs files are being imported into quick books and I'm not sure what application the end user may have if the end needs to open and manipulate the data in anyway before actually importing these two files into quickbooks; so I decided on a file formate that is universal to a wide assortments of applications.

MikeKD: If I could create a "Temporary Folder" inside the "Temporary Folder" where I could place the cvs files, then I would like to try that.  Is that possible ??

Wim Decorate: As to placing the data into a "text" fields and exporting the field contents ... I have different column names between the two reports.  So the second group of data being placed into the field, the "1st" row are "Field Names", wouldn't they end up as a "Record Row" on the export fields in the "List" of rows ... "YES / NO" ??

Link to comment
Share on other sites

Hi Snozzles,

As far as I'm aware, FM can't create or delete folders in the OS; therefore it's only a temporary folder if we go into the Finder and manually delete it each time.

For this to work, you'd have to give the two files the same name each export so they overwrote previous CSVs there.

Having said that - out of the 3 answers given, mine does seem the most clunky!!!

Link to comment
Share on other sites

 

Wim Decorate: As to placing the data into a "text" fields and exporting the field contents ... I have different column names between the two reports.  So the second group of data being placed into the field, the "1st" row are "Field Names", wouldn't they end up as a "Record Row" on the export fields in the "List" of rows ... "YES / NO" ??

Given that the files are very different, then no, my approach won't work.  So why not do two separate exports, then use Send Event/Perform Applescript depending on your platform to create one zip file and email that to the user?

 

Hi Snozzles,

As far as I'm aware, FM can't create or delete folders in the OS

Yes it can.  You can make FM talk to the OS in a number of ways and creating folders is simple.

And in 14 there is the new Get Directory that allows for the creation of folders by the user:

http://www.filemaker.com/help/14/fmp/en/html/scripts_ref1.35.151.html#1184903

 

 

 

  • Like 1
Link to comment
Share on other sites

Hi,

Thank you everybody.

Wim Decorte: Thank you, you've mention the "Apple Script" solution in another post with a link, I'm looking for that now. I've got several issues on this cvs file export and I am working through and keeping everything organized, I will try to be non-redundant coming back if I get stuck.

I will attempt the "applescript" since my customer is on mac.

Thank you again.

Tom :-)

Link to comment
Share on other sites

Snoozle,

Here is a sample file. Tear it apart. Feel free to post back questions, if you have them.

This sample file does the following with FileMaker and AppleScript:

 

1) Creates a FOLDER on the Desktop to dump 2 CSV files

2) Dumps the CSV files in that new folder

3) ZIPS the new folder

4) Generates an Email with that ZIP file attached

5) Cleans up the files created on the Desktop

Hope this helps!

dwdc_2cvs2Email.zip

Edited by dwdata
Link to comment
Share on other sites

Snoozle,
 

Here is a sample file. Tear it apart. Feel free to post back questions, if you have them.

Hope this helps!

dwdc_2cvs2Email.zip

 

I really wish that you'd give some bullet points as to what to expect in the sample file instead of relying on us to download it just to find out...

Hi,

 

Wim Decorte: Thank you, you've mention the "Apple Script" solution in another post with a link,

The link in the other post was to the native Get Directory script step in FM14, and has nothing to do with AppleScript.

The point about AppleScript (and Send Event for Windows) is that it allows you to interact with native OS-level scripting to extend FM's functionality.  There is a lot you can do there without having to rely on plugins.

Link to comment
Share on other sites

I really wish that you'd give some bullet points as to what to expect in the sample file instead of relying on us to download it just to find out...


Yeah... Fair enough. Sorry Wim. I will try to put little more efforts in my post in the future. To be honest, I literally was running late to a gig and wanted to get this posted, before I left. The bullet points are in my sample file. I will modify my original post for others.

Thanks!

Link to comment
Share on other sites

This topic is 3152 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.