Thank you for your clarification. I understand that you would like to retrieve unique records based on a few specific columns.
Currently, when grouping is applied, it merges duplicate rows into a single row. However, in your case it may not appear as expected because the GROUP BY is applied to all columns, while the Repeating Table is only displaying a subset of those columns. This can make some rows appear as duplicates.
Original Message:
Sent: 03-04-2026 08:32
From: Norbert Prumbs
Subject: Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY
Sorry Verma,
I have to disagree:
The "<>" can be intentional part of a criterion in the reference data list. So please note, for example the packaging type criterion "<>SA" in the reference data list.

This excludes the label data within this row for materials of packaging type "Sack" (bag).
So for instance: when searching for label data to packaging type "SA", the query must consider all rows in the reference data list where packaging type contains "SA" and (!) ignore those rows where this packaging type explicitly is excluded by "<>SA".
In your screenshots of outputs generated, I miss several other label data (e.g. ZLB_PRCN) also fitting to your search criteria (assumingly: MM_Material_Type "IDEN" + Plant1 "310" + HLP_Container_Type_PH "KA".
This is because your code includes "KA" by LIKE and excludes "KA" by NOT LIKE at same time. So only the rows with packaging type "*" are considered for output.
Please do not change the selection criteria within the code, but investigate more focus on the GROUP BY functionality.
P.S.: In case the character string "<>" within the code is interpreted by the system as a not equal operator, please show me how to code it explicitly as text.
Regards
------------------------------
Norbert
Original Message:
Sent: 03-03-2026 03:20
From: Divya Verma
Subject: Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY
Hi Norbert,
The contradiction you mentioned already exists in your original query - I have verified this. My change was limited only to removing the <> from the NOT LIKE condition and did not introduce any new logical conflict.
Regarding the GROUP BY, it is working correctly and grouping the similar rows as expected. I have tested it, and the results are consistent.
Please find attached a screenshot of the output generated from your query for your reference.

Let me know if you would like me to further analyze the grouping logic.
Thanks.
------------------------------
Divya Verma
*Precisely Software Inc.
Original Message:
Sent: 03-03-2026 02:48
From: Norbert Prumbs
Subject: Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY
Thanks Divya,
for your try. But before testing your suggestion: What do you hope to achieve with your suggestion to change the filter condition? Please note the contradiction between the two filter criteria:
... AND ([Criteria_Packaging_Type] LIKE '%[/my:myFields/my:HLP_Container_Type_PH]%' ...
versus
... AND [Criteria_Packaging_Type] NOT LIKE '%[/my:myFields/my:HLP_Container_Type_PH]%'
...
I suspect that this does not solve my actual GROUP BY problem.
Please keep on trying on a solution.
Regards
------------------------------
Norbert
Original Message:
Sent: 03-03-2026 02:30
From: Divya Verma
Subject: Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY
Hi Norbert,
Your solution is perfectly fine. I've just made a small change to the query - I removed the <> from the NOT LIKE condition, as it isn't required.
The final query is provided below. Other than removing <>, no additional changes were made to the original query.
[MM_Packaging_Unit] = 'PC'
AND ([Criteria_Material_Type] LIKE '%[/my:myFields/my:MM_Material_Type]%' OR [Criteria_Material_Type] = '*')
AND ([Criteria_Plant] = '[/my:myFields/my:Plant_1] ' OR [Criteria_Plant] = '*' OR [Criteria_Plant] = '[/my:myFields/my:Plant_1]*')
AND ([Criteria_Packaging_Type] LIKE '%[/my:myFields/my:HLP_Container_Type_PH]%' OR [Criteria_Packaging_Type] = '*')
AND [Criteria_Packaging_Type] NOT LIKE '%[/my:myFields/my:HLP_Container_Type_PH]%'
AND [Status] = 'public'
GROUP BY
[Criteria_Plant],
[Criteria_Material_Type],
[Criteria_Packaging_Type],
[Status],
[MM_Label_Category],
[MM_Packaging_Unit],
[MM_Label_Size],
[MM_Generation_Variant],
[MM_Copies]
I'm attaching the updated solution for your reference.
Regards,
------------------------------
Divya Verma
*Precisely Software Inc.
Original Message:
Sent: 02-26-2026 06:47
From: Norbert Prumbs
Subject: Automate EVOLVE - How to query Reference Data List by Query Element using GROUP BY
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.

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.

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.



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

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

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.

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
------------------------------