This example demonstrates how to attach a file to Salesforce as an attachment. The sample pipeline will read a file from source, query an account record from Salesforce and attach the file to the record as an attachment.
![79ac4a8ad23f56c457d6b39d324b7cc0ae7b22bf.png 79ac4a8ad23f56c457d6b39d324b7cc0ae7b22bf.png](/t5/image/serverpage/image-id/4031i1B6DCCCB9995CFFF/image-size/large?v=v2&px=999)
- Salesforce Read will query the account record that the file will be attached to.
![b8cbbd53ca30fa0b229fc8310457ea0f55e2d0b1.png b8cbbd53ca30fa0b229fc8310457ea0f55e2d0b1.png](/t5/image/serverpage/image-id/4013i3C9067DC91C33215/image-size/large?v=v2&px=999)
- Extract the Salesforce record Id and OwnerId from the Salesforce output.
![a246ad126be9e6f231eeeb232c0d3c3a3785fc86.png a246ad126be9e6f231eeeb232c0d3c3a3785fc86.png](/t5/image/serverpage/image-id/4023iDD632AB38281CFA4/image-size/large?v=v2&px=999)
- Use the “Binary to Document” to convert the binary file stream to document for mapping
![aec40b49c88a935762f27ddb07323a52202c44c5.png aec40b49c88a935762f27ddb07323a52202c44c5.png](/t5/image/serverpage/image-id/4036i3C106C6DAFBE7110/image-size/large?v=v2&px=999)
- Merge the ID with the File using the Merge option in Join Snap
![6dcff47816cff6e4d5323ec830c63f61c030b52d.png 6dcff47816cff6e4d5323ec830c63f61c030b52d.png](/t5/image/serverpage/image-id/4025i1BDF33B9422638BF/image-size/large?v=v2&px=999)
- Map the Salesforce Attachment structure
![522457539b04370232439685f689db82e74e3f14.png 522457539b04370232439685f689db82e74e3f14.png](/t5/image/serverpage/image-id/4026iCABE1721BBD22A60/image-size/large?v=v2&px=999)
- Create Salesforce Attachment record using Salesforce Create Snap
Configuration
Snaps in Use: Salesforce Read, File Reader, Binary to Document, Mapper, Join, Salesforce Create
Downloads
Salesforce Attachment_2017_02_23.slp (10.3 KB)