Skip to main content
Nintex Community Menu Bar

How to get the size of the file in workflow

  • March 20, 2018
  • 1 reply
  • 190 views

Hi All,

 

How to get the size of the document(which was stored in Datbase) in workflow? Not in smartform

 

i mean i have a document which was stored in the database, if the document size is X then i need to attach to my email event. 

 

Regards

Sri

1 reply

Forum|alt.badge.img+16
  • March 21, 2018

Hi,


 


It seems like you might have to write a stored procedure with (Data length) and surface it as a SmartObject. It then can be used to calculate the size of the file in your workflow. I'm not an expert in SQL, someone else can confirm this.


https://docs.microsoft.com/en-us/sql/t-sql/functions/datalength-transact-sql


 


For example, i have a SQL table with a column (type: nvarchar(max)), it's setup to store file size that is greater than 1 MB.


I can use something like this to show the file size.


Select [name], DATALENGTH(file_attachment) AS SizeInBytes, LEN(file_attachment) AS NumberOfCharacters
FROM [K2].[dbo].[TestFileSizeSMO1]