You are viewing limited content. For full access, please sign in.

Question

Question

Email HTML table

asked on March 24, 2014 Show version history

Hi Guys

 

I am trying to setup a notification email based on information from a SQL table that may have multiple rows.

 

I am creating a token called %(Report) with the following initial value for the table header <th>Store Code</th><th>Item Code</th> 

 

Then for the details i append <tr><td>%(ForEachRow_StoreCode)</td><td>%(ForEachRow_ItemCode)</td></tr> token for each row result.

 

 

The workflow runs and the report token ends up with the following value.

 

<th>Store Code</th><th>Item Code</th>
<tr><td>005</td><td>INS29          </td></tr>
<tr><td>005</td><td>INS321         </td></tr>
<tr><td>001</td><td>W3811-2997     </td></tr>
<tr><td>001</td><td>W3815-3001     </td></tr>

 

In the email body I type this in

<table>
%(Report#"HTML"#)
</table>

 

But it does not bring back any info except for the Table Headers( which are not aligned )

 

 

Any ideas?

 

 

 

 

 

0 0

Answer

SELECTED ANSWER
replied on March 24, 2014

Try %(Report#[ ]##"HTML"#)

 

There is a space between the [ ]. 

5 0
replied on March 24, 2014

Thanks Ed

 

That pulls all the data now :)

 

The alignment continued to give me an issue but i resolved it by including the <table></table> into the token instead of in the email editor.

 

1 0
replied on March 24, 2014

Good to hear, I was going to ask about that next. The reason including it in the e-mail like.

 

<table>

%(Report#[ ]##"HTML"#)

<table>

 

results in poor alignment is that by default, the e-mail editor inserts <br /> at each new line. So your resulting HTML looks like:

 

<table><br /><th>.....

 

and that <br /> is what causes the alignment problems.

 

Also, the [ ] part of the token instructs the token resolver to join all values of the multivalued token as a single line that is space delimited. The reason this is needed is that by default, token resolving assumes that in the middle of the string, a token should be a single string. Since it's not really smart enough to know how to format a multivalued token, it just grabs the first value.

1 0
replied on March 24, 2014

Great thanks for the explanation ! All makes sense now :)

0 0
replied on July 28, 2014

Hi Ed:

 

Is there a resource that has a comprehensive list of .NET formatting expressions such as HTML?

 


Tony

0 0
replied on July 28, 2014

The HTML format is actually something specific to Laserfiche Workflow to help it format your e-mail. 

 

.NET formats are used for

 

Numbers: http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx

 

Dates: http://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx

0 0
replied on July 29, 2014

Hey Ed, thanks. I found those a little while back with the help of the Laserfiche help button, thanks again!!

 

Tony

0 0
replied on July 29, 2014

Ed, I guess it's worth asking - are there anymore "hidden" expressions besides HTML that could be of some use, formatting for emails or other?

 

 

Tony

0 0
replied on July 29, 2014

There are not (we add them as people request them). Although, it is worth mentioning that if you use the Summary token from the Retrieve Version History activity, it is automatically formatted as a table.

0 0
replied on April 19, 2017

We use the HTML expression in several workflows to send reports from workflow. For some reason we have an extra space on the last line and the last column. Does anyone know why this may be?

Expression Used: 

<table border="1"><body style="text-align:center;">%(Report#[ ]##"HTML"#)
</body></table>

0 0
replied on June 27, 2018 Show version history

Did you get anywhere with this Zach ? I've noticed the same issue of a <br> being inserted after each row in the Assign Field Values activity. The field value in this activity, is one continuous string, so no CR LF any where. As is the string in the E-Mail activity body.

Colin.

PS I can put this data\html in a script as I know that works fine but it would be nice be able to use the method above.

 

0 0
replied on June 27, 2018

Unfortunately this is still an issue for us. We haven't taken the time to do more troubleshooting. Here is a screenshot of a Migrate Volume Report that we run nightly. As you can see, the extra spaces are still being inserted on the last column. I've included Screenshots of the formatted e-mail and one of the Token config as well.

 

0 0
replied on June 28, 2018

Ok thanks Zach. I've ended up just building the data and HTML in  VB and popping it in an SDK Script activity. In there, you can use SetToken to create a new token with all the HTML and your data in it.  Then just use that token in your email, making sure you use the 'HTML' format after the token. Works fine and you can do anything with your table then.

Colin.

0 0
replied on February 15, 2021 Show version history

Not exactly sure why formatting it this way works, but in your table header token, remove the "</th></tr>" after your last column header in the table. In your example the "Volume Report ATPR1LFATG" token should end with "...<th>Created By</th><th>Entry Path"

 

Then in your Table Data token (your html table tags should be "<td>" instead of "<th>" since its now table data, not table headers) remove the "</td></tr>" after your last column data and add "</br>". So again, in your example the "Entry Info ATPR1LFATG" token should end with "..._CurrentEntry_CreatedBy)</td><td>%(ForEachATPR1LFATGDEFAULT_CurrentEntry_FullPath)</br>".

 

Adding the </br> will remove the line break that is being added after each ForEach iteration that seems to accumulate in the last cell of the table. Additionally, removing the </th></tr> is also eliminating an unwanted line break in the header. Really not sure why closing the <th>, <tr>, and <td> tags is creating an extra linebreak, but this is the way I've found to eliminate it. 

0 0

Replies

replied on February 28, 2016

i need more information about %(Report) token i need to design table in workflow email body as per the number of records ?

 

any suggestion .

 

Thank you. 

0 0
replied on February 19, 2019

Hi, im trying to run something similar to this by adding data to a table in an email.  I have gotten the data to populate and the email to show the table, however, there seems to be some field appending to the beginning of the "<th>" that is showing up.

 

 

Here is what I am using in the workflow:

I create the token "Report" at the top level with the header

 

Then I append to the existing "Report" token with 

 

From there I am including in the email the following string:

 

<table border="1"><body style="text-align:center;">%(Report#[ ]##"HTML"#)</body></table>

 

This ends up with that strange field prior to the first table header.  I can't seem to figure out where it's coming from.

0 0
replied on February 19, 2019

Never mind, figured it out.  My <body style> tag was creating inside the table.

0 0
replied on May 1, 2024

This was a huge help. Thank you

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.