Ability to attach multiple files to an email based on a template

I have a client looking to attach 2 documents to the same email.

Document 1 is a .csv file based on template A
Document 2 is an .xls file based on template B

I understand we can attach an unrelated files (not associated with a template) Is there any way I can do this? Open to ideas

0 23 1,515
23 REPLIES 23

Create a workflow rule with two actions.
The first action would be a SaveFile action that creates and archives the .csv file.
The second action would be an Email action that creates the .xlsx (not .xls) as an attachment.
The second action would include the file archived by SaveFile as an Other Attachment.

Thanks Phil Iโ€™ll try this today and report back

Hi Phil,

  • What is the format of the expression I should put in Other Attachments? Something like //appsheet/dataโ€ฆ ?

  • Is there a way to automatically delete those files after the email is sent? The files will accumulate quickly

Thanks Phil

This is working in case your csv file always has the same file name:
Enable โ€œDisable Timestamp?โ€. With this, you will always have only 1 file.
A new file created, will override the existing file.

Perfect! Thanks Fabian

See topic " Locating Other Attachment Files" in this article https://help.appsheet.com/en/articles/3337387-email-other-attachments

There is currently no way to automatically delete the files created by the SaveFiles.

Hi Phil, It looks like Iโ€™m not doing something right. Iโ€™ve followed your instructions above but it seems the file name has a reference added to the end preventing the attachment is my assumption. I have the date time stamp option turned off but the date and another reference is being added. Here is a copy of the file: Could really use some help. Thanks

2X_b_b205bd849deebfc3c8ed127a43b79a1aa56e38f0.png


Hi Daisy,

Just saw this post. I replied to your later posts on the same topic, but I am replying here also in case someone sees this post in future.

You need to enable the โ€œDisable Timestampโ€ option on the SaveFile action. At the moment, that option is โ€œOffโ€ so the timestamp is being included.

Iโ€™m so sorry Phil, I completely misread/understood the flag. Iโ€™ll try it this afternoon.

Thanks so much

No Problem The option is confusing.

Hi Phil, sorry but it looks like I still have a timing issue or so. The email is sent prior to the file being accessible. Any ideas on how I can insert a delay of some kind in between the actions to allow the file time to hit the directory so it can be picked up?

Sorry Phil Iโ€™ve tried just about everything I know how on this file and canโ€™t get it to attach. The Disable stamp is ON. Any help would be greatly appreciated.

Thanks

Hi Daisy,

I can investigate if you provide:

  1. Your account id
  2. The app name
  3. The rule name
  4. Your permission to debug using your app

Account ID: 539632
USAgain-539632
send_route_data_collection
Yes

Thanks Phil

I am still investigating, but can you check one thing?

It looks like SaveFile is archiving the files to the โ€œFilesโ€ folder. For example, the archived file has a name like โ€œ/appsheet/data/USAgain-539632/Files/CollectionSummary_RS67890543211234567890.pdfโ€

You email action does not appear to be including the โ€œFilesโ€ folder in the attachment location.

You may simply be archiving the file to one place and looking in another.

ok will do but Iโ€™ve been watching the directory to see when the file posts vs. when I receive the email and Iโ€™m getting the email way before the file posts to the directory.

I have a vc set for the file name. Should I include the full name (โ€œ/appsheet/data/USAgain-539632/Files/CollectionSummary_RS67890543211234567890.pdfโ€) in that vc and use the vc in both Save File and Other Attachments?

We start from the App Data Folder, which appears to be โ€œ/appsheet/data/USAgain-539632โ€ in your case. We assume that location, so you should not specify that. Try specifying the rest of the name including the โ€œFilesโ€ folder so โ€œFiles/CollectionSummary_RS67890543211234567890.pdfโ€.

We are definitely writing the file to the archive folder before attempting to retrieve it by name. It is possible that Google Drive will take time between when SaveFile writes the file to the archive folder and when Google Drive will allow us to retrieve it by name. In other words, it may take time for Google Drive to propagate information about the newly added file to all of the Google Drive servers running in Google Cloud.

Are you having success getting this to work?

Hi Phil, I inserted โ€œFiles/CollectionSummary_โ€&[Route Barcode]&".pdf" into the VC and referenced it in the Save File and other attachments as mentioned above but no luck.


Hi Phil, think I got it!

  • I was unable to use the VC and am using a direct file name in the File Name Prefix.
  • How to grab the file: Based on my reading the Save File action places the file into the Files/ directory by default so I donโ€™t need to specify Files/ in the File Name Prefix. (If I do insert Files/ into the file name it creates another directory called Files/ so youโ€™ll have Files/Files/)
  • Other Attachments: I Do need to specify the directory in expression (see below).

The file is grabbed successfully with the scenario above but unfortunately I see the text โ€œFiles/โ€ in my file name.

How do I remove โ€œFiles/โ€ from my file name?

Reference Images


Hi Daisy,

I am not sure I fully understand. Can you clarify?

I understand we need to put โ€œFiles/โ€ into Other Attachments expression but โ€œFiles/โ€ is appearing in the attachment name. The client just wants โ€œCollectionSummaryxxxxx.pdfโ€ vs. โ€œFiles/CollectionSummaryxxxxx.pdfโ€

see the actual email received by client

Iโ€™m having the same problem and I didnโ€™t find a solution. The Attachment has a file name that begins with โ€œFiles/โ€ฆโ€

Top Labels in this Space