โ04-13-2023 11:26 AM
I've set up a custom alert notification for one of my Databricks SQL queries, and it triggers correctly, but I'm not able to get the actual results of the query to appear in the notification email. I've followed the example/template in the custom alert documentation, but {{QUERY_RESULT_ROWS}} and {{QUERY_RESULT_COLS}} don't seem to deliver any usable data.
Could someone assist with the phrasing of this alert notification? Am I using the handlebar formatting incorrectly? I would like the email to show the results of the triggered query, and it sounds from the documentation like it should be possible.
Notification code:
# of results:<br/>
{{QUERY_RESULT_VALUE}}<br/><br/>
Query result rows:<br/>
{{QUERY_RESULT_ROWS}}<br/><br/>
Query result cols:<br/>
{{QUERY_RESULT_COLS}}
Output in email:
"# of results:
1
Query result rows:
[{'column_7627b0db': 1}]
Query result cols:
[{'name': 'column_7627b0db', 'friendly_name': 'column_7627b0db', 'type': 'integer'}]"
โ04-14-2023 12:05 AM
The actual query results are not displayed in the alert unfortunately. You can pass the alert condition etc, but not the raw results of the underlying query.
I hope this will be added in the future.
A workaround is to add a link to the query, so the receiver of the alert can click the link and execute the query. Not ideal, but something.
โ04-14-2023 12:05 AM
The actual query results are not displayed in the alert unfortunately. You can pass the alert condition etc, but not the raw results of the underlying query.
I hope this will be added in the future.
A workaround is to add a link to the query, so the receiver of the alert can click the link and execute the query. Not ideal, but something.
โ04-14-2023 10:44 AM
Thanks so much -- was afraid that might be the answer, but good to know I'm not missing something!
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.