Is there a way to retrieve Select Distinct for a attribute when retrieve a list from database.

0
Hi there   Is there a way to retrieve "Select Distinct" for a attribute when retrieve a list from database.   I want to retrieve a list of objects with a unique item name or a list with no duplicate item names.   Is there a way to do it inside the retrieve action as i dont want to do it manually with a microflow?   Regards, Patrick 
asked
2 answers
0

I don’t believe that that is included as an option in the default Retrieve action of a microflow. However, you can use OQL to accomplish this: https://docs.mendix.com/refguide/oql-select-clause/

There’s some information/documentation about how to build that yourself using a  custom Java action, but there is also a much-used OQL package in the Marketplace: https://marketplace.mendix.com/link/component/66876 

Hope this helps! 

answered
0

No, that is not possible using the retrieve-activity. You will need to post-process it with your own custom-created list-sort and looping microflow. But that is always second-best to any other solution that does distinct on database level.

In OQL it is easy:

from yourmodule.yourentity
select distinct *

 

answered