Attaching an external PDF file to a PDF created in workflow based on a condition

Hi - is it possible to have several external PDF files and based on certain conditions be able to append the external PDF to the PDF going through workflow? For example - I am creating a letter in workflow as a PDF output and I have 5 PDF files in a separate folder. The condition would be something like: if record.fields[“ROLLOVER”]==“YES” && record.fields[“ROTH”] == “YES” then attach Roth.pdf to the letter being created. Or is there some way to do this in Designer? My data source for the letter portion is a csv. Previously in Planet Press 7 I imported them as an image and then placed conditions on them. They are front and back so I had break them up and say page1 and page2.v I am trying to avoid that here and hopefully find an easier way.

Thank You
Amy

You could look at these previous posts that seems to be related to your issue:

How to insert pages from one PDF to another

Dynamically load multiple mutipages PDF into Designer

How to dynamically insert T&C pages into PDF

That should give you a head start.

Hello Amy,

You may want to take a look at the following How To:
https://learn.objectiflune.com/en-us/planetpress-connect/howto/add-custom-email-attachments

Erik

Thanks hamelj. I already tried to use the posts you are suggesting. I couldn’t figure out how to relate it to what I am needing.

Hi Erik - your link definitely gives me a place to start.

Thank You

Hi - I have tried for a couple days now to get this to work and no luck so far. Ultimately I wanted to use external attachments as I will have 5 different one but in an effort to just get it to work I brought just one inside my template and created simple condition. I am trying this. I wasn’t sure what to use as my selector as the documentation only references using head for an email attachment. So I used .PDF and placed it in my tag.

if (record.fields[“PART ALLOC DIR”]==“ROYES” && record.fields[“HAS ROTH”] == “ROTHNO”){
results.append(“”);
}

Does anyone have any ideas?

Thank you

Hi Amy,

Take a look at the “PDF from Resource”-script in the attached package. It shows how to attach the PDF files. Wrap the code with your if statement to make it conditional.

Hope this helps,

Erik

https://learn.objectiflune.com/qa-blobs/9656127754460779620.ol-package