Amplify your Workflows with HTML
Managers and administrators need to keep an eye on everything that is going on in their particular department. Accounting managers may need to know which invoices were processed daily, while systems administrators may be concerned about which folders were created every week. This article outlines how to use HTML token formatting in Laserfiche Workflow 8.3 or higher to embed tables and Laserfiche Web Access links inside emails.
Note: some e-mail clients do not support displaying HTML and some e-mail clients may have the HTML option disabled for security reasons.
Scenario
As a case manager in the Department of Social Services, Amy is always concerned about the status of the various cases. Even while traveling, she needs to be on top of what is happening in her department. Here is how to create a daily e-mail report for Amy with a list all of the cases that are in process, along with their Web Access link, assigned case worker, and status.

For the purposes of this example I will use the following folder structure and document template:

The process
I will create tokens that contain HTML formatting and insert them into an e-mail. Here is what the final workflow design looks like. The configuration of each activity is described in detail below.

Assign Token Values
The first “Assign Token Values” activity is going to create a new multi-value token named Report. This token is going to have the following value composed of HTML for table headers and labels for the three different columns:
<tr><th>Case Status</th><th>Case</th><th>Case Worker Assigned</th></tr>

Search Repository
The “Search Repository” activity will run a search of the Laserfiche repository for all case files that have a status not equal to “Unassigned.” When configuring this activity, I will use the following advanced search syntax: {[Case Files]:[Case_Status]<>”01 Unassigned”}

For Each Entry
I will now use a “For Each Entry” activity to group all of the activities that will be performed on each of the documents returned by the “Search Repository” activity.

Retrieve Field Values
The “Retrieve Field Values” activity is used to convert all of the field values in the “Case Files” template into tokens for use in the e-mail later on.

Generate Web Access URLs
In order to create the Laserfiche Web Access links for each case file in the e-mail, I will use the “Generate Web Access URLs” activity. This will allow Amy to click on a link and view any of the case files directly in Web Access. Amy can stay current on her department’s work even when she is not in the office.
Each URL will be stored in a token named “URL.”

Assign Token Values 2
I will now use another “Assign Token Values” activity. This time though, I will select “Modify” instead of “Create,” and I will select the “Report” token that I created earlier in the workflow. I will select “Append to existing values” and insert the following HTML as a new value:
<tr><td>%(RetrieveFieldValues_Case_Status)</td><td><a href="%(GenerateWebAccessURLs_URL)">%(ForEachEntry_CurrentEntry_Name)</a></td><td>%(RetrieveFieldValues_Case Worker)</td></tr>

Finally, I will include an “E-mail” activity outside of the “For Each Entry” loop. This e-mail will be configured to contain the new table. Place the “Report” token inside of HTML table creation tags:
<table border="1"><body style="text-align:center;">%(Report#[ ]##"HTML"#)</body></table>
When inserting the token, configure it as follows:
- Check “Apply Formatting,” and type in “HTML.”
- Check “Apply Index,” and select “All values separated by Line Break.”

This is what the final email will look like.

Publish this workflow. Instead of starting rules, set this workflow to run on a schedule, for example every Friday morning at 8 a.m.

More information
HTML formatting can make email reports much more powerful and easier to read. For more information about HTML, take a look at one of the multitude of HTML resources available online. To read about various other ways of formatting tokens, check out this whitepaper: “Tokens in Laserfiche Workflow.”
