# 自动化脚本Schedule PM使用Data Explorer结果未发送PMs

**URL:** <https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135>\
**Category:** Bug\
**Tags:** automation\
**Created:** [2023 年6 月 21 日 09:46 UTC](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135 "2023-06-21T09:46:11Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

作者： ![davidb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidb/32/554671_2.png) [@davidb](https://meta.discourse.org/u/davidb)\
发布日期： [2023 年7 月 4 日 09:15 UTC](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135/23 "2023-07-04T09:15:25Z")

</div>

此 PR 应能修复这些问题：

> <https://github.com/discourse/discourse-data-explorer/commit/ee308c637cbcb5128dad2de89db3aaf16cbcb9bf>
>
> This PR fixes 2 issues that were picked up by users for the Scheduled Data Explo…rer Report automation script and a couple of small improvements to better match the format of manual data explorer query results.
> 
> The first issue is that within result\_to\_markdown the colrender contains null values, and we are currently checking length (previously treated as a packed array but it is actually a sparse array). Therefore we can check if the current index of the array is null rather than checking the size of the array.
> 
> The second issue addresses the blank query\_params field. When the data explorer script does not require any params to be passed in via the automation script then it will have a nil value, however it should be defaulted to {} within the plugin.
> 
> To improve formatting the markdown table for PMs is now aligned to left and where values are substituted (for example user\_id becomes username) we then include the id within brackets, for example:
> user\_id becomes username (user\_id)

---

_[View the full topic](https://meta.discourse.org/t/automation-script-schedule-pm-with-data-explorer-results-not-sending-pms/269135)._
