Question
CYBG
GB
Last activity: 18 Jul 2017 5:27 EDT
How to automatically attach a file to a work object?
Hi,
In our 7.1.8 application there is a point in a flow where we want to automatically attach a file from a network or local drive. I've looked at the Smart Shape "Attach Content" but it only allows attaching a binary file, and even then we can't specify an external file, only one that has already been uploaded, so I'm not sure what possible use it could be. The help isn't particularly helpful either as it is very different to the actual shape.
Is there an OOTB activity/function/flow action that can take a filename parameter and attach the file to a work object? Or is it a case that we have to manually create an attachment page and set the value of pxAttachName to be the path of the attachment? And even if we do that, what else do we need to do to get the data to actually upload?will the "SaveAllAttachments" activity do that?
And can someone at Pega tell us if they will ever update the help to include this information? I have not been able to find anything in the PRPC help that covers any aspect of automatic file attaching (outside of report PDFs).
Many thanks,
Mike.
Hi All,
Thank you for your assistance. As a workaround I have found the following is giving me the functionality I require:
1. The contents of the new CSV file are written to a single property.
2. A new Data-WorkAttach-File page is created.
3. The property is encoded to Base64 and moved to the attachment page's pyAttachStream property.
4. The new attachment is saved and linked to the work object.
However, as a more practical solution I will be implementing an external table with the CSV data stored in rows that can be retrieved via a report definition and exported to Excel for a better user experience. Neither of these is ideal, but in the absence of proper automatic attachment fuctionality it will suffice.
Cheers again,
Mike.