Sending one or more attachments in email from Attachments List

  • 8 September 2016
  • 3 replies
  • 1 view

Badge +4

I woul like to send all present attachments in present in current Item. Attachments are saved in K2 SmartObject (ProcesName Attachments) and not in SharePoint Item.


 


Is anywhere some example how to do it?


 


Thank you!


3 replies

Badge +6

These inline functions could be worth investigating.

 

http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#files_inline_function.html

 

What methods does your smartobject have? Does it have a list method?

Badge +4

My Attachements SmartObject is autogenerated from SP 2013 list (Two SmartObjects; List and Attachement SmartObject). The available methods are: Add, Get, Get List, Get, Remove, Remove all. Yes it has Get List.

 

I'm designing WorkFlow with Studio, where I have following Files functions: Get File from Content, Get File From Location, Get File from Sharepoint 2010, Get File From SharePoint Item Reference, Get InfoPath Attachements, Get Process Attachements.

 

I thing that function "Get file from SharePoint is not ok, while I dont have attachements in Library.

 

Currently I managed to show hyperlink of attachement. Therefore I know file location, his name, but actual file I'm not able to attach.

 

 

Badge +7

I am assuming that what you have is a sharepoint list with attachments and not a document library. For each list there are two smart objects created by default one is for the list and the other for attachments.

 

I am aslo assuming that somewhwere earlier in the workflow you knwo the item ID, title or exactly which item in the list has your attachment.

 

You can use the file inline editor called "Get File from Content". Drag this to the email attachment line. When it opens you have to specify filename and Content.

 

For Content use the list smartobject for attachments. Specify either the title or ID as input or add a filter. For the return property you want file.content. You can use the same smart object call and input to get the file name just get the return property called Name.

 

You would have to play around with this to return multiple documents but the basic premise is the same.

 

Alternately you can make this smart object call beforehand and store the file content in a data field and then use the data field in the email attachment. This method will show up in the workflow data so you can see if you actually got a document. It is just a large encoded text string.

 

I hope this helps

Reply