OL Learn

Using workflow to copy one PDF and rename based on data file

Hi - I am wondering if we can use workflow only to take one pdf, create approx 100 copies and rename them based on a data file ( not sure if it going to be xml or csv ) without using Design?

Thank you

Sure thing. So I’ll assume you’ll have CSV, though it won’t really matter which it is in the end.

The first thing you’ll likely want to do is split the CSV by each record. This will put you inside of a loop.

Next, you’ll read out whatever values you need from that CSV (assuming you need any at all for the file name). Store those in variables so they don’t get lost.

Finally, use the load external file plugin to get a copy of the PDF. This won’t delete the source PDF, it’s always just a copy. Send it out through a Send to Folder with whatever name you like.

You could do this without a data file driving it too, just use the loop plugin and tell it how many times you want to loop. On the inside of that loop you’ll do the same as above, pick up a copy and drop it in a new home with a new name.

1 Like

Perfect - thank you !!

I may have spoken too early on this. This works great in debug. But when I run it through the input folder it creates pdf with 1kb (not valid) . Am I missing a setting someplace?

Sounds like you’re not successfully loading the copy (load external file), so it’s outputting the split CSV file with a PDF extension. Open it in notepad to see for sure.

If it’s working in debug but not live, I’d guess it’s probably a permissions issue where the Workflow service account can’t access the location where the base PDF is stored.

Now it is perfect!! It was a permissions issue. Thank you !!!