Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on March 31, 2025 10:27PM
Likes: 0
Replies: 3
Hi,
I have a SQL query that when it returns no data, I need to be able to change the email content of my scenario reporter.
I am currently setting a project variable and have a couple questions:
1. Can I use the project variable to conditional change which email reporter to use?
2. If no to #1, what is the best way forward? When this variable is True I need to change the email header vs the default
thx
Operating system used: WIndows11
Project variables can work for this but they are not the best solution since they are persisted in the project so in effect they change the project every time. It's best to use scenario variables. The documentation is not very good on using SQL results to create a variable. However I wrote this post today showing how to use a metric to conditionally execute scenario steps. You can use a similar approach with your mail reporter which will be able to access any scenario variables you define. I am not a big fan of using Execute SQL steps since they hardcode the table name. I would use a regular dataset. And here is one post I wrote earlier showing how to use a count of records metric of a dataset to control an email.
I am going to try all of your suggestions. In this particular case we may get by with setting the variable because it is a one-off dataiku project executed in our automation node. But I get your point that this would not work if users were to rerun the project scenario and expecting a new result.
The added benefit of scenario variables over project variables is that they are defined in the scenario so any users trying to figure out where the variable comes from will be able to see the definition in the scenario rathen than knowing about project variables.