cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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

Kaniz
Community Manager
Community Manager

Hi @ merca! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your post. Sure, I shall inform the doc team. Thanks!

jose_gonzalez
Moderator
Moderator

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.

Kaniz
Community Manager
Community Manager

Hi @Ola Pukstad​ , Thanks for your concern. We'll try to include the example requested by @Merca Ovnerud​  in the documentation as soon as possible. Thanks for flagging it @Merca Ovnerud​ .

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?

Kaniz
Community Manager
Community Manager

Hi @Merca Ovnerud​ , I completely understand the frustration you’re feeling. I’m sure I’d feel the same way. Can I ask you a few questions so we can get this resolved?

Kaniz
Community Manager
Community Manager

Here is the link which may answer your question related to {{QUERY_RESULT_ROWS}} -

https://discuss.redash.io/t/how-can-i-formatting-result-of-query-result-rows-in-custom-alerts-that-i...

Please feel free to reach out in case you've more questions about it. We're here to help you 😊 .

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 😉

Kaniz
Community Manager
Community Manager

Hi @Merca Ovnerud​ , So happy to help you!

Would you like to mark it as the best answer?

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

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.