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