Create Attachment
An Attachment is a way to attach a file or folder to a Salesforce record. Files & Folders attached to a record show up in the CloudFiles widget on the record page in Salesforce. Below is an example of an attached folder

In this article we show how to add this action to your flow and configure the parameters.
In your flow builder, search for the element named "Create Attachment". You can also find this action in the CloudFiles category when you click "action" element in "Add Element" box. Select the action to insert it into the flow.

Please configure following parameters after inserting the flow action
- Library- One of sharepoint, google, onedrive, dropbox, box, cloudfiles
- DriveId - Drive Id for SharePoint or Google Drive. This parameter is not needed for other storages. To get the value of Drive Id, please refer to Create Folder flow action.
- Resource Id - Id of file or folder. You can get it from one of the earlier actions in flow like "Create Folder".
- Resource Type - folder or file
- Salesforce Record Id - Id of the Salesforce record. In a record triggered flow, this would be {!$Record.Id}

The Apex action returns a custom type called Attachment. You can use fields from this type, like id, name etc. You can use these fields in subsequent flow actions or save them as custom fields on record to use outside this flow.
