# Sintassi dei parametri di Data Explorer in Automazione

**URL:** <https://meta.discourse.org/t/syntax-for-data-explorer-params-in-automation/355916>\
**Category:** Bug\
**Created:** [5 Marzo 2025, 7:08pm UTC](https://meta.discourse.org/t/syntax-for-data-explorer-params-in-automation/355916 "2025-03-05T19:08:21Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![ted](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ted/32/283882_2.png) [@ted](https://meta.discourse.org/u/ted)\
**Post date:** [13 Marzo 2025, 10:01am UTC](https://meta.discourse.org/t/syntax-for-data-explorer-params-in-automation/355916/9 "2025-03-13T10:01:01Z")

</div>

C’è stato effettivamente un bug qui, e in parte grazie all’indagine di @Arkshine, è stato relativamente facile da correggere:

> <https://github.com/discourse/discourse-data-explorer/pull/363>
>
> \### What is the problem?
> 
> When setting up an automation to create a DM or a po…st with a report on a recurring basis, and using a Data Explorer query that has parameters, we encounter an error.
> 
> \### Why is this happening?
> 
> The \`.params\_to\_hash\` currently expects an array of arrays for the parameters, e.g.:
> 
> \`\`\`ruby
> \[\["group\_name", "admins"\]\]
> \`\`\`
> 
> but in reality they seem to be arrays of hashes:
> 
> \`\`\`ruby
> \[{ "key" =\> "group\_name", "value" =\> "admins" }\]
> \`\`\`
> 
> \### How come we only found out now?
> 
> We do have tests for the report generator, and we do pass query parameters to it, but 1) we hard-code the parameters as an array of arrays and 2) the parameters aren't in the query used as a fixture.
> 
> \### How does this fix it?
> 
> This change makes \`ReportGenerator.params\_to\_hash\` work with arrays of hashes. It also preserves the ability to work with nested arrays in case this is used somewhere else.

Questo è già stato unito, quindi una volta che il tuo sito sarà stato distribuito, dovresti essere sbloccato @ganncamp.

Se ho capito bene, desideri un’automazione che sia una mappatura uno-a-uno tra un gruppo e il suo report? (Cioè, `group_a` riceve un report con dati di `group_a`, ecc.)

 ![Screenshot 2025-03-13 at 5.53.57 PM](https://global.discourse-cdn.com/meta/original/4X/6/9/d/69d861d4c233d430c412233da2957a5e864a9ee2.png)

Non c’è (attualmente) alcuna connessione tra l’elenco dei destinatari e i parametri del report, quindi per realizzarlo dovresti impostare un’automazione per gruppo. In questo caso, potresti voler cambiare il parametro in `group_id`.

---

_[View the full topic](https://meta.discourse.org/t/syntax-for-data-explorer-params-in-automation/355916)._
