Skip to main content

Hi all,

 

Got a requirement to allow users to add multiple files to a form, then save the form as a PDF and send an email with the PDF (of the form) and also any attached files.

 

Any ideas which is the cleanest way to do this?

 

I have had a dabble and created a k2 smartobject and have the 3 fields, id(autonumber), requestid (integer) and attachment(file)

 

I then created a "requestid" parameter on the view (just for testing gave the paramater a value of 2)

Then created the editable list from the smo and edited the save button rule and changed the 3 inputs of the create,save,delete rules to save the requestid as my parameter.

 

I ran the form, added 3 files and clicked save. This all works, i now have 3 seperate objects in the SQL table with 3 seperate ids, the files and all have the requestid=2

 

Creating the PDF of the form is fine as well.

 

The requestid will be got from the output of doing a save on the form itself and retrieving the ID

 

But my question is, how do i add all the files into the email as seperate attachments. The grouping is obviously the requestid, but can anyone show me how to attach the multiple files to an email?

 

Can these multiple attachments be added in Designer as well as K2 Studio

P.S. These are all files users would add from a PC etc (there is no sharepoint involved)

 

Thanks

Hello,


 


Using K2 Studio there is the ability to add multiple attachments within the Email Event wizard under the advanced mode.


 


https://help.k2.com/onlinehelp/k2blackpearl/UserGuide/4.7/default.htm#Thick_Client_Wizards/Event_Wizards-General/Email/Email_Event.htm?


 


This will allow you to attach the multiple files.  From you scenario it sounds like this needs to be handled dynamically, which would present a different challenge.  You might be able to utilize expressions within the add attachments to check against how many items were saved in the form to conditionally add attachments.


 


Hope this helps get you pointed in the right direction.


 


Thanks,


Colin


 


 


Hey, thanks for the reply.

 

Got this working, found an article on the web which gave the outline of how it works.

I tested it on my dev box and works like a charm.

 

Just use the requestid to return all results matching it and attached them to the email attachments (via K2 Studio)

Couldn't get this to work via Designer which is a shame

 


Reply