Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
Showing results for 
Search instead for 
Did you mean: 

Azure Databricks User Alerts: query_result_table

New Contributor III


How can I set up the notification email to show all of rows from query_result_table, not only first 10?


Community Manager
Community Manager

Hi @MeggieFox , 

By default, the body of an email notification for a Databricks Job with a query result table will display the first 10 rows of the query result table. However, you can configure the notification to display all the rows by customizing the email template used for notification.

Here’s how to configure the email template:

  1. Go to your Databricks workspace and select User > Account Settings > Notifications.

  2. In the Email template section, select Custom.

  3. In the Custom template textbox, replace the existing message with the following template:

Results of query {{}}
{% for row in job_result.result().collect() %}
{{ row }}
{% endfor %}
  1. Save your changes.

The customized email template uses a Jinja2 template that iterates through all rows in the query result table and appends them as a string. This ensures that all query rows are included in the notification email, instead of just the first 10 rows.

Now, when you run a Job with query results, the notification email will display all of the rows in the query result table.

Thank you for your reply, but it is not exactly what I thought. I use SQL alerts so dont know where should I go to put this changes written by you.

Workspace > user settings:



I check 


Can you help me with my problem? I have a workspace admin but I cannot find the path as you wrote. When I go to the Account Settings > Notifications I can only see:



New Contributor III

I see that my previous message has been cut. 

So, I just wanted to check where can I change email setting using the code above, because when I open  User > Account Settings > Notifications I can see only option like this:



there is no place to configuration emails. 



Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!