# Report Schedule Trigger

**URL:** <https://forum.inductiveautomation.com/t/report-schedule-trigger/39651>\
**Category:** Ignition\
**Created:** [October 14, 2020, 1:30am UTC](https://forum.inductiveautomation.com/t/report-schedule-trigger/39651 "2020-10-14T01:30:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![afarzin1](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@afarzin1](https://forum.inductiveautomation.com/u/afarzin1)\
**Post date:** [October 14, 2020, 1:30am UTC](https://forum.inductiveautomation.com/t/report-schedule-trigger/39651/1 "2020-10-14T01:30:55Z")

</div>

I have a report set up that displays the results of a query in a table. The report is sent out via email on a schedule. The issue is that I only want to send this report out if the query returns some value, not if it’s null. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [October 14, 2020, 10:57am UTC](https://forum.inductiveautomation.com/t/report-schedule-trigger/39651/2 "2020-10-14T10:57:39Z")

</div>

I’m not aware of the reporting scheduler being able to conditionally restrict sending like that through simple GUI means, but you can always script it using the Run Script action rather than the Email action. Just use the dataMap dictionary to find your query data and do a simple if on it:

```auto
if query is not None:
     #send report

```

---

<div class="post-metadata">

**Author:** ![afarzin1](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@afarzin1](https://forum.inductiveautomation.com/u/afarzin1)\
**Post date:** [October 15, 2020, 6:33pm UTC](https://forum.inductiveautomation.com/t/report-schedule-trigger/39651/3 "2020-10-15T18:33:08Z")

</div>

How would I trigger a report using scripting tho? I want to run my script only once (large output) and maintain the formatting of that the report tool provides.

---

<div class="post-metadata">

**Author:** ![matsons](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@matsons](https://forum.inductiveautomation.com/u/matsons)\
**Post date:** [October 16, 2020, 5:24pm UTC](https://forum.inductiveautomation.com/t/report-schedule-trigger/39651/4 "2020-10-16T17:24:00Z")

</div>

Take a look at [system.report.executeAndDistribute()](https://docs.inductiveautomation.com/display/DOC80/system.report.executeAndDistribute)
