Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Truncate Flow designer

harshi_ramesh
Tera Expert

Hi 

I have been using the below script in the Toggle scripting for variable, in order to convert the attached image to base64 and send it via payload. 

var attachSysId = fd_data._1__get_catalog_variables.attachment_1;

if (!attachSysId) {
    return '';
}

var attGr = new GlideRecord('sys_attachment');
if (!attGr.get(attachSysId)) {
    return '';
}

var gsa = new GlideSysAttachment();
var base64Data = gsa.getContentBase64(attGr);

// Build XML
var xml = ''
+ '<Attachment>'
+ '<Attachment_Name>' + attGr.file_name + '</Attachment_Name>'
+ '<Attachment_Type>' + attGr.content_type.split('/').pop() + '</Attachment_Type>'
+ '<Snow_CorrelationID>' + fd_data.subflow_inputs.ritm.number+ '</Snow_CorrelationID>'
+ '<Attachment_Content>' + base64Data + '</Attachment_Content>'
+ '</Attachment>';

return xml;

 This was working fine as expected, but now if a image of above 10MB is getting attached it is not getting converted to base64 and I receive empty. It is working as expected for images less than 10MB.

 

I now plan for using a Script Include for base64 conversion and call the SI into my Flow action script step.

Is there any possible way to fix this in flow?

 

Thanks in advance.

0 REPLIES 0