0

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

  • Hi Robaker, thank you for the reply. That was exactly my guess, but I don't know how to create a name variable to avoid that. I added the target file image to my question above. Thanks again! – Jose Castano Oct 04 '19 at 13:30
  • Hi Robaker, I added a name variable for the file names as "$name" in the transformation, and added that variable to the target file as [name]. Tested and works great. Thank you! – Jose Castano Oct 04 '19 at 14:59

1 Answers1

0

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.

robaker
  • 1,028
  • 7
  • 11