Skip to main content

We have a form that collects a single attachment and stores it in a SQL database.  Data type for the attachment field is an nvarchar(max).  This works properly and the attachment is stored in the DB as a collection. 

 

However, we want to then send that attachment attached to an email.  I tried using a Reference to that SmartObject (to the SQL table) but that didn't do anything.  No attachment on the email but no error either.  I then tried adding a direct SmartObject to the Attachment field on the email, passing in the ID to that row in the SQL table, returning the Attachment field.  No luck there either.  I'm definitely getting the right ID for that row (because i see it in reporting attached to the variable) but i just can't get the attachment to go through. 


What am I missing? 

I'm experiencing the same issue. 

I found success following the below logic:

  1. Save logic configuration is set to first create the record.
  2. Then the Save as PDF method is executed to generate the PDF, bringing the PDFID back into the Form as a parameter through the output mapping.
  3. The PDF attachment file is then loaded into the form using the parameter (PDFID).
  4. A Save method is then executed to update the record with the PDF attachment file. (The attachment is now available in the workflows item reference)
  5. The workflow is then started with attachments brought in from the referenced item in the Context Browser.

 

 

 

 


A very interesting solution. I was trying to avoid 2 things you are doing. 

 

1. Saving the Attachment back as a PDF puts that whole file into the K2 database, which given the size of some of these in my case was something that i was trying to avoid. 

2. Converting to a PDF will cause some of the formatting to be lost, which will likely not be what the clients desire.  

 

I will ponder what you said though and see if i can work around it.  


Hi,


 


 


It sounds like the issue is related to the SmartObject property. Perhaps, you can change the existing property to use File Type instead of Memo field, see below.


 



Thanks khanh,

 

The SmartObject property type is currently set as File.


Yes, for me, this was the problem.  The auto-generated SmartObject (I know, I know!) was set to Memo. 

 

Thanks, Khanh!! 


Reply