Automate

 View Only

Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY

  • 1.  Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY

    Posted an hour ago

    Hi Community,

    I need to query a "Reference Data List" with multiple criteria and insert the result aggregated into unique records into a "Repeating Table" element of my form.

    To do this, I use a "Query Element" in my form with SQL code as a "Raw Query." The code contains the selection conditions and the SQL statement "GROUP BY."

    After unsuccessful research in the Precisely documentation, the Knowledge Community, and the entire Internet, I found out through numerous attempts what the code for the "Query" parameter should look like.

    Ein Bild, das Text, Screenshot, Software, Display enthält.

KI-generierte Inhalte können fehlerhaft sein.

    Important: Following conditions must be met!

    1. "Raw Query" must be selected.

    2. The code in the "Query" property does not contain SELECT, FROM, or WHERE.

    Ein Bild, das Text, Screenshot, Schrift, Dokument enthält.

KI-generierte Inhalte können fehlerhaft sein.

    3. The syntax follows SQL standards ("=" instead of "==", 'AND' instead of "&&", etc.).

    4. In the "Data Connection," all (!) columns of the "Reference Data List" addressed by the "Query" code and the "Set Fields" property must be selected.

    Ein Bild, das Text, Screenshot, Schrift, Zahl enthält.

KI-generierte Inhalte können fehlerhaft sein.

    Ein Bild, das Text, Schrift, Zahl, Reihe enthält.

KI-generierte Inhalte können fehlerhaft sein.

    Ein Bild, das Text, Schrift, Zahl, Reihe enthält.

KI-generierte Inhalte können fehlerhaft sein.

    5. The GROUP BY statement in the "Query" code must also contain all addressed columns, including those that are only used for selection!

    Ein Bild, das Text, Schrift, Screenshot enthält.

KI-generierte Inhalte können fehlerhaft sein.

    6. The "Automatically retrieve data when form is opened" option can be selected in the "Data Connection", but does not have to be.

    Ein Bild, das Text, Screenshot, Schrift, Algebra enthält.

KI-generierte Inhalte können fehlerhaft sein.

    7. In the "Query Element," "Append to Repeating Group" does not have to be selected in order to fill the form element with data.

    If all these conditions are met, the "Query Element" successfully fills the "Repeating Table" element in the form with grouped values.

    However, this does not work reliably with unique records, as the columns with the selection criteria must also be grouped.

    This leads to ambiguous records in the "Repeating Table" element.

    Ein Bild, das Text, Screenshot, Software, Computersymbol enthält.

KI-generierte Inhalte können fehlerhaft sein.

    So there is no real grouping as in proper SQL.

    My questions are:

    A. How to setup the "Query Element" correctly, so that the GROUP BY statement only outputs unique records via the output columns only?

    B. What alternatives may applicable instead of a „Query Element" to get unique records into a „Repetaing Table" element?

    I would welcome any suggestions for a solution to my problem.

    Many thanks in advance.

    Regards

    Norbert



    ------------------------------
    Norbert
    ------------------------------