Download Multiple Attachments from Salesforce using Jitterbit

324 Views Asked by At

I am able to create a query for attachments and download 1 individual file like this:

  • SOQL:

SELECT Body, Id FROM Attachment WHERE Id = '00P4M00000q8ChI'

  • Code on Body:

<trans>$content = root$transaction.response$body$queryResponse$result$records.Attachment$Body$; $decoded_content=Base64Decode($content); WriteFile("<TAG>Targets/Files/FMLA _Extract</TAG>",$decoded_content); </trans>

But when the multiple attachments are pulled, it creates 1 large file. This large file sometimes shows the first page, but most of the time Adobe is not able to read it. Instead, I would like to have multiple files listed on my target directory.

Thank you in advance for your help!

Target file:

FMLA_Extract

1

There are 1 best solutions below

0
robaker On

What does your file target look like? (Targets/File/FMLA_Extract). I'm guessing it's configured to append to existing files and you're not changing the file name, so they all get glommed on top of each other.