How to create a foreach that reads all names inside an entity? I don't want duplicate

In fact our problem is the following:

1- We've created an entity to store unique names [role name];

2- We couldn't use a static entity because we need to insert data at run time;

3- How can we certify that we don't have duplicated data?;

4- How can we build an ForEach to get all names and compare with the user's input?

Solution

Hi Meta3Group

3- You can create a UniqueIndex in your entity for your Name attribute:

4- On aggregate you can filter the collumn with a value that user typed

Solution

Eduardo Pires wrote:

4- On aggregate you can filter the collumn with a value that user typed

Yes create an Aggregate that filters using Id and Name. If the list is empty then proceed otherwise, throw an error message or any warning to the user.