When moving from on-premise Outlook, to SaaS Case handling solution SalesForce, printing is not top of mind. Here is how to use email to print through a Flow with SalesForce Service Cloud.
This flow uses 3 Flow Screen Components:
- datatableFSC by Alex Edelstein
- Send Email from GravityLab
- Lightning Navigation button by GravityLab
The buttons are optional, but makes the whole thing a lot nicer! 🙂
What the flow does, is that is takes the Case, finds the related emails, then based on selected email, finds all the attachments. Then using datatableFSC, sends an email (with Send Email) to a receiver service (UniFlow by Canon) that parses the email and attachment, and prints it.
Notice how using the Lighting Navigation buttons, lets you have just a small section visible on the Lightning Page? There is also feature in the button component to let you launch a flow as a message box. This would have been better, but the parsing of recordIDs through to the flow doesn’t work in the current release.
Now, the next step is where the datatableFSC comes into play. Its not currently possible to send a populated sObject Variable to a record Selection choice, or to use any of the built in functions when you cant do a direct getRecords to find the related files (Enhanced Email with Attachments stored as files).
But if you use datatable, you can loop through the Content Document Version and Content Document to populate a sObject record variable, and have datatableFSC render it. Like this:
I have used a formula to create the title, back into the Content Document Object scheme, but its just stored in the flow. The datatableFSC then outputs to a new variable, that is used by the Send Email Action.
Send the emails with attachments
Now, for each document selected, it calls the Send Email action, and gives the Content Document ID, email body etc. Unfortunately, only 1 attachment per email, and max 10 emails per flow. Next step might be to integrate this with Google Cloud Print or the likes, but for now its UniFlow that prints the email to the Users local printer. Delay is a couple of seconds, but PDFs mostly work.
The whole flow
I dont claim any points for flow beauty, but here is the flow as it sits now. There is 2 branches, one if there is only 1 attachment. Then it skips the datatableFSC section. And one where there are several attachments to the case.