cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

SQL Alert Email with QUERY_RESULTS_TABLE results in table with no border

SaugatMukherjee
New Contributor III

Hi,

I am sending databricks sql alerts to an email. I am trying to get the query results table in the body of the email.

I have used a custom template with 

{{QUERY_RESULT_TABLE}}

and this works fine for a teams alert. In Teams, I can see the table properly formatted as a table.

However, using the same for an email destination, results in a table with no borders- which is pretty much useless.

I have tried various options and none have worked.

the best I could get to was a horizontal row seperator using  the hr tag.

e.g.

<html>
<table>
<tr><th>AssetId</th><th>Source</th><th>CycleId</th><th>Delay_Hours</th><th>LastLoadedTimestamp</th>
{{#QUERY_RESULT_ROWS}}
<tr>
<td><hr style="margin:0"/>{{AssetId}}</td> 
<td><hr style="margin:0"/>{{Source}}</td>
<td><hr style="margin:0"/>{{CycleId}}</td>
<td><hr style="margin:0"/>{{Delay_Hours}}</td>
<td><hr style="margin:0"/>{{LastLoadedTimestamp}}</td>
</tr>
{{/QUERY_RESULT_ROWS}}
</table>
</html>

 

but I miss the column borders. I also tried setting the border property of the table using

<table border="1">

Like, I said:

Just using QUERY_RESULT_TABLE works for teams, it is only outlook email, that is the problem. Outlook is a essential mode of communication in every organization, so this is quite important that people are able to make sense of it.

I tried bunch of "style" tags, but those are not recognized by the template.

I have gone through the documentation and understand he supported tags: https://learn.microsoft.com/en-us/azure/databricks/sql/user/alerts/#--create-an-alert 

What else should I be doing?

 

0 REPLIES 0
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.