Attachment
Overview
Attachments are files that can be associated with an entry. This includes audio files, office documents and etc.
- From version: 2020.20
Properties
attachmentType
attachmentType: AttachmentType
The attachment file's type.
const attachmentType = workflowApi.currentThread.entries[0].attachments[0].attachmentType;
caption
caption: string
The attachment's display name.
const attachmentCaption = workflowApi.currentThread.entries[0].attachments[0].caption;
fileSize
fileSize: string
The attachment file's size, You can use this property for both showing the file size or to limit uploading of large file attachments.
const attachmentFileSize = workflowApi.currentThread.entries[0].attachments[0].fileSize;
id
id: string
The attachment's unique id.
const attachmentID = workflowApi.currentThread.entries[0].attachments[0].id;
Methods
getAttatchmentContent
getAttatchmentContent (): Promise<string>
This function returns the attachment file's data. It is used to download or present the file in the appropriate viewer.
workflowApi.currentThread.entries[0].attachments[0].getAttatchmentContent().then((content) => {
console.log(content);
})
Returns Promise<string>
The actual Attachment's file data.
setAttachmentContent
setAttachmentContent ( data : string): void
This function captures the attachment file's data. It is used to add or change the file.
workflowApi.currentThread.entries[0].attachments[0].setAttachmentContent(content);
Parameters
-
data:string
The actual Attachment's file data.
Returns void