Read attachment from DB and attach to email within workflow - no longer works in K2 5.x

  • 10 December 2019
  • 1 reply
  • 58 views

Badge +8

Hi there.

 

In K2 4.7 (web based workflow builder) we have a process where we use a read method against a database smart object (the property type is "File") and the output properites go to a variable.  From there we use the "Get File from Content" to attach that file to an email that's sent out by the workflow.  It has worked perfectly for years. 

 

Fast forward...trying to re-build this workflow in K2 5.x  

 

First thing that's wierd is that with 4.7, when you do the read method on the SMO it gives you two output parameters, "Attachment Name" and "Attachment Content" (the database column is titled Attachment).  With 5.x, it only gives a single parameter which is just "Attachment".  We're using the same SMO as the original 4.7 workflow used...it's just the workflow is only supplying one output property after the read method.

 

So, I go ahead and map the single output propery to a variable in the workflow that I titled "Attachment Data" and then use the "Get File from Content" function, and manually supply the filename as Attachment.xlsm (it's an Excel macro enabled workbook).  

 

When the workflow runs, the attachment comes back as un-openable.  Error reads, "...because the file format or file extensinon is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."  

 

Any thoughts on this?  We're built the 5.x workflow just like the 4.7, it just does not seem to work.  

 

 

 

 


Reply