External content by Bjoern Poller July 1st, 2025;
We designed an application in which the initial situation had to be documented using up to eight images (each up to 5 MB in size). We couldn't reduce the image sizes, as we needed the ability to zoom in on details for damage assessments.
To prevent these images from unnecessarily taking up space in the workflow history, we came up with the idea of transferring them to the attachments section instead. Since no further processing was required - the images were purely for documentation - this was a suitable solution. The file names of the images could be derived from the values stored in the picture field.
Since we initially struggled a bit with the CONVERT, my colleague Lena and I agreed that this functionality deserves an easy-to-copy guide in the Knowledge Base.
Additional options to expand on this could include:
Here’s the MS SQL SELECT statement to copy and reuse
(replace the {...} placeholders with the actual field values as shown in the image):
SELECT
CONVERT(image, CAST(STUFF('{10380}', 1, CHARINDEX(',', '{10380}'), '') AS xml).value('xs:base64Binary(.)', 'varbinary(max)')) AS Content,
'FileName.jpg' AS FileName
FROM WFElements
WHERE
WFD_ID = {WFD_ID}