cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Value array {{QUERY_RESULT_ROWS}} in Databricks SQL alerts custom template

merca
Valued Contributor II

Please include in documentation an example how to incorporate the `QUERY_RESULT_ROWS` variable in the custom template.

12 REPLIES 12

jose_gonzalez
Databricks Employee
Databricks Employee

Hi @Merca Ovnerud​ ,

Here is the docs link https://docs.databricks.com/sql/user/alerts/index.html please let me know if this helps or you still have more follow questions.

Hi Jose,

I believe @Merca Ovnerud​ asked for the docs to include an example, but I cannot see that this has been added in the link you provided.

merca
Valued Contributor II

@Jose Gonzalez​  Just sending me to documentations when I clearly state in my question that they are missing examples from the said documentation is borderline rude. And not responding even when someone tries to point this out, is even more.

Anyhow - could someone please tell me if there is possible (and how) to include data from the {{QUERY_RESULT_ROWS}} in the alert email?

merca
Valued Contributor II

Hi @Kaniz Fatma​ ,

Thank you for the link. That was exactly what I was looking for. I hope this will be included in databricks documentation for others who may have the same problem!

Best

-Merca-

PS: Ask all the questions you like 😉

merca
Valued Contributor II

Done!

Aleks
New Contributor II

I was wondering about this same question, however, the link is no longer accessible. Could the example be included int he official databricks documentation?

merca
Valued Contributor II

@Aleksandar Mirkovic​ I second that an example should be provided in documentation! (hint, hint @Kaniz Fatma​ ​ 😉 )

Here is an example how to add the QUERY_RESULT_ROWS in email: (query result is table with 2 columns: column1,column2)

<table>
<tr><th>column1 header</th><th>column2 header</th></tr>
{{#QUERY_RESULT_ROWS}}
<tr>
<td>{{column1}}</td> <td>{{column2}}</td>
</tr>
{{/QUERY_RESULT_ROWS}}
</table>

 note of caution: if a receiver have turned off html rendering in email, this does not look good!!! The tags will be written out as plain text

CJK053000
New Contributor III

@merca I have been using this same solution in alerts and it has been working great until yesterday, 10/9/2024. Now the results are showing up blank in my alert notification. Are you experiencing the same?

dec1mo
New Contributor II

Hi @CJK053000, I'm experiencing the same behavior. Have you figured out the workaround?

abaghel
New Contributor II

I am having the same issue as well from today. Any idea what is wrong and how to fix it ?

CJK053000
New Contributor III

I have a support ticket open and am awaiting feedback. I will report back once I have more info.

CJK053000
New Contributor III

Databricks confirmed this was an issue on their end and it should be resolved now. It is working for me.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group