You are viewing limited content. For full access, please sign in.

Question

Question

Append two or more electronic files in the same mail using workflow?

asked on December 22, 2014

How to append two or more electronic files in the same mail using workflow with another image?

Thanks

1 0

Replies

replied on June 27, 2022 Show version history

Since attaching multiple results from a Search Repository activity to an Email activity as file attachments is likely still of interest to people who may find this post, my colleague @████████figured out a clever way to do it.

Create a temporary folder (suggest naming w/ the WF instance ID for uniqueness), create shortcuts for each file, then attach the folder to the email. Don't forget to clean up the temp folder afterward. Adding error handling for Email activity failures (for example, if the combined attachments exceed max message size) with at least a Try-Catch is highly advisable. 

6 0
replied on June 1, 2023

Easy and simple ... thank you very much for posting this.

1 0
replied on December 22, 2014

Do you mean that you want Workflow to combine these files into a single document to email? Or are you asking how to add multiple attachments to a single email?

0 0
replied on December 22, 2014

I have a document that comes from forms with two or more attachments electronic files.

A wf starts and i have to send a single email with all the attachments files.

Search for entries and used "by each entry" but with this at the end I have so many mails as documents found and

I want only one email with all the documents found.

Thanks Miruna

 

0 0
replied on December 22, 2014

It is not currently possible to attach the results of a search to a single email.

0 0
replied on December 23, 2014

Hi Miruna,

 

I've not got access at the moment to test but if a token is declared as an "Entry" type, would that work? Could that be added to an email as an attachment?

 

-Ben

0 0
replied on December 23, 2014

Not quite. Only entries exposed by other activities can be attached. You can also attach files from disk. What you can't do is iterate through a set of files and append them to the same email.

The problem here is that we don't allow attaching a results set from Search Repository to a single email. That's by design because the number of results returned by a search can be arbitrarily large and most mail servers have restrictions on the sizes of attachments.

0 0
replied on January 27, 2015

Is it possible to include a list of results in the body of a single e-mail, even if they can't be included as attachments?

0 0
replied on January 27, 2015

You can create a multi-valued token, then inside of a "For Each Entry" loop which gets its entries from your search, append the current Entry Name to the token and then put that token in the body of your email.

1 0
replied on January 28, 2015

Tried that, and it only seems to add the name of the first result as opposed to any others.  What's more, it will only include more than one piece of information from the result (name, path, iteration of the "For Each Entry" process) in the token if I make sure to keep all of them on the same line.  I've definitely allowed the token to have multiple values, and am definitely performing the token modification within a "For Each Entry" process tied to the search I'm running.  What am I missing?

0 0
replied on January 28, 2015

Can you try indexing the token in the email so it looks like %(Results#[]#) 

-In the token editor or dialog click Apply Index and select all values separated by a ... then choose how you want them

2 0
replied on January 28, 2015

That seems to be working now.  Thanks!

0 0
replied on March 12, 2015

Kevin,

I have a workflow set up that does a nightly search on several repositories and OCR's any documents that are not OCR'ed. I send a nightly e-mail report with the number of documents OCR'ed. I would also like to include a list of the Entry Names and Entry IDs of the documents OCR'ed. I have successfully created the workflow that retreives the entry information in a for each loop and appends the token variables. However, after I call over 10-12 appended token variables in the e-mail activity, the workflow will take a very long time to validate, publish, and run. If I call above 20 appended token variables, the workflow will not validate and publish at all. I need to call anywhere from 100-400 appended token values. Is there anyway I can configure this more efficiently or anything I can do to fix this issue? See the screenshots for more information.

Thank You,

Zach

1 0
replied on March 13, 2015

Hey Zach,

I'm not able to reproduce this issue. Are there any errors in the Workflow Admin error log or Event Viewer?

2 0
replied on March 16, 2015 Show version history

Kevin,

I do not see any errors located in the Workflow Admin or Event Viewer that seem to be associated with this issue. The virtual server we have workflow service running on has 4GB RAM and 2 processors at 3.00GHz. The CPU will peak at 100% while attempting to validate/publish this workflow when calling over 10 appended token variables in the e-mail activity. The workflow will not publish and the CPU will stick at 100% until I cancel publishing of the workflow. You can see from the screen shots below the error log from Workflow Admin Console and how I have the e-mail configured. Any thoughts?

Appended Token Value E-mail.jpg
0 0
replied on March 16, 2015

Zach, what version of Workflow are you using?

0 0
replied on March 16, 2015

We are running Workflow 9.1.1.381 with the Laserfiche 9.1 Client Suite on our live server. I could try updating our test server first to 9.2 and see if the issues still persist. Thanks Miruna.

0 0
replied on March 16, 2015

There were a couple of optimizations made to 9.2 for publishing workflows with lots of tokens.

0 0
replied on June 17, 2015

I found a workaround for the problem of making multiple attachments when WF must iterate to find those attachments:

 

Since the email activity has to have an instance of an entry in order to make the attachment, I run a parallel with a condition nested inside of it. If there is a found entry with an index # it finds the document and therefore makes it attachable by the email activity.

So far, there is no lag in the multiple parallel activity. I have 10 branches. The lag comes when I the entries are converted to a PDF in the email activity. Total time has been under a minute even with 10 attachments.

 

I was following this thread trying to find a workaround. Hopefully this gives you an idea. There are more details to the solution. Let me know if you are interested and I am happy to share.

 

Cheers!

 

4 0
replied on July 23, 2015

I am interested in a solution for this as well, but do not understand your reference to an index #.  Do you mean the iteration of a duplicate named file?  If so what if your looking for all the files that were independently uploaded to a form plus the form all uniquely named, but names are unknown to workflow?  The only common piece of information to base the search is the BP Instance ID assigned to a metadata field.  Any ideas?

0 0
replied on July 23, 2015

If the instance ID is unique, then you can use a Search Repository activity to find all entries which have a certain value in that metadata field, just like a search in the Laserfiche Client. Then you can collect them names as shown above. 

 

The reference to indexing is just a way to properly display the tokens. Putting a multi-value token in a text field will usually only display the first item, so index them to show all values. The syntax %(Multi Value#[,]#) means display all the values and separate them by a comma.

1 0
replied on July 24, 2015 Show version history

Kip, let me take apart your message and reply to it.

I am interested in a solution for this as well, but do not understand your reference to an index #.  Do you mean the iteration of a duplicate named file?  

No, it is the iteration of each attachment you need to make. The above activities exist within a 'For Each' activity where each entry is one that you need to attach to an email. I use the token calculator to 'add 1' before each entryid.

Token calculator:

Token including calculator digit:

The 'each entry' token is used later conditionally to process in the parallel 'index' branches:

The example above is on the Index 3 branch.

Lastly, I use the Find Entry activity to find the relevant entry without the preceding token calculator digit:

Once you use the Find Entry activity, you can attach it to an email. The only downside to this workaround is that for each attachment you need to make, you must have a parallel branch.

If so what if your looking for all the files that were independently uploaded to a form plus the form all uniquely named, but names are unknown to workflow?  

If you can return the entries you want somehow, and get them into a For Each activity, then you can use my workaround. I don't have Forms, so I am just taking a stab at a solution here...

The only common piece of information to base the search is the BP Instance ID assigned to a metadata field.  Any ideas?

Maybe query the LF table to determine the entryid?? Try using SQL or Crystal Reports to find the entries you need. Then use the SQL code you used to place in a Custom Query activity. Run a Find Entries on the returned entry ids. That is where I would start. Just some thoughts...

Hopefully, you have gotten an idea or two from this. I am happy to get more granular if it would be helpful.

1 0
replied on October 23, 2015

Thanks Chris. I've just implented your solution, works great.

1 0
replied on April 7, 2016

Hi Chris, 

This is a great post. We have exactly the same need so we tried implementing the workflow which you have described. I have attached my workflow here with this post <email workflow.png>  

1) I have defined 2 tokens required for each entry loop 

2) Token calculator doesn't seems to increment 

3) Find entry 2 - with ID: regular expression to locate the correct id seems to be not working 

 

for 1,2,3 errors refer attachment <errors and issue.png>

Please help me with this issue...

thanks in advance  

Rajah

email Workflow.png
errors and issues.png
2 0
replied on April 7, 2016

Raja, I'll need to refresh my memory. I'll get back to you ASAP.

1 0
replied on April 7, 2016

thanks a lot chris ... that will be very helpful 

0 0
replied on April 10, 2016

Hi Chris  

Did you get any chance to look up !!! 

0 0
replied on April 20, 2016

OK Raja, I found some time. I see some things that need fixing in your pics.

Here are your questions:

1) I have defined 2 tokens required for each entry loop 

Make sure they are empty in your "assign for calculation" activity. In other words, no data should be in the tokens that are there. "index Count" should be 0 and "each entry" should be empty. They get modified later and then data is added.

2) Token calculator doesn't seems to increment 

Make sure your activity "assign calc entryid" modifies the "index count" token with data from the Token Calculator. Also make sure that the "index count" token is a 'modify' token.

3) Find entry 2 - with ID: regular expression to locate the correct id seems to be not working 

Since the Token Calculator is not naming the entries correctly, the Find Entry (and Find Entry 2, etc.) won't find a match. You also must put the Find Entry activities within the conditional sequence. You don't want to run X number of Find Entry activities if you don't have to. If you nest the Find Entry with the conditional sequence, it only Finds the Entry if there is one there. Here is what my conditional sequence rules look like for Index 2:

 

Each of your issues are dependent on one another. Start with your first issue and then troubleshoot your way down your list.

Hope this helps,

Chris

0 0
replied on April 21, 2016

Hi Chris,

Thanks a lot. This was really useful. Now my workflow works perfectly. Thanks again. 

 

Regards

Rajah

2 0
replied on November 2, 2021

So were you able to send multiple documents from the repository by one email?

0 0
replied on November 3, 2021

You can attach as many as you have a branch for, so it is up to you. The thing to be careful about is exceeding the size an inbox will allow.

1 0
replied on October 20, 2016 Show version history

Hey Chris, 

Any chance you can tell me a couple things regarding the above setup? Is the "Each Entry" a multi-value token? How are you getting each sequence to run successfully? 

If it's not multivalue, it only runs the sequence for which is equal to (ie. 4 documents found, will run the 4th sequence). If it is multi-value (which I think it should be), when it does the find entry, it only works on the first one and then all of the others don't work. How do I tell it to look at the next value, with of course, not using the "for each value" function (If I do, I cannot use the email function). I do have it set to match a regular expression looking for the index number _2 (docID_2)

Thanks!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.