

Your comments indicate that the timeout might need to be increased.
#DECODE BASE64 ATTACHMENT CODE#
Functions can also make your code a bit more “ dry”, but leaving it “wet” is fine if you understand it better that way. If content of attachment is malformed or not Base64 encoded. It will also make it easier to deal gracefully with any failed api calls. decodeFromBase64 - if checked decode attachment content using Base64 decode before output. This will help make the general flow of the script easier to see and maintain. You might want to use different variable names to indicate that there are actually multiple tasks.Ĭonsider breaking up the script into smaller functions that get called by a single main function. You use the single variable taskId to refer to different tasks created across the course of the script. The difficult part is uploading an attachment to match Salesforce's specific multipart/form-data template. Keep in mind that your Cloudconvert token can be viewed by any collaborator who looks at the script. Upon receiving a response, client applications must decode the base64 data to binary (this conversion is usually handled for you by the SOAP client). You have already been able to get and send emails using nodemailer with Gmail API. You want to achieve this using nodemailer. You have the base64 data, and you want to send it as the attachment file.

That way if the names of those fields change, your script will not break. 1 Answer Sorted by: 0 You want to send an email with an attachment file. I recommend also using script setting to select the field with the base64string and the attachment field. Here are a few thoughts regarding your code. Let base64String = selectedRecord.getCellValueAsString(Īuthorization: `Bearer $], Let selectedRecord = await input.recordAsync( Let cloudconvertToken = "YOUR TOKEN GOES HERE"
#DECODE BASE64 ATTACHMENT HOW TO#
No need to bring your own cloud storage service.Īny suggestions, how to make the code better, welcome! // Click the "gear" icon in the top right to view settingsĭescription: "A script that uses settings",ĭescription: "Pick any table in this base!", To decode base64 attachments you have to send request using one of the provided. The really cool part is that they will host the file for 24h. This plugin decodes Base64 encoded attachments using provided REST API. Might need to tidy it up a bit but it works.
