Entity should not store duplicate from REST API Response

I am using Persistable Entity to store response of REST API. I have two issue here I am calling MIcroflow to get Response from REST API but I found that each time Microflow gets called it is adding data in Entity and it is getting duplicate records, how could I avoid this There might be a duplicate values for one feild like “Metadata” in API response, I want only unique values can be store here, so that I can filter data based on Metadata. I tried using the association but not able to resolve it Can you please help here
3 answers

You can try setting some validation rule in your entities for some fields to be unique, here’s a screenshot:

This way, mendix will not insert duplicated values.


Maybe, you should consider have a look at your microflows logic. 

It’s not normal to insert duplicated with only 1 call, maybe there’s something on your logic that is causing this problem too.


If you use an entity in an import mapping, you will get a new object every time the mapping is called. If you don’t want that data to be persisted, you can use a non-persistable entity.

You can then determine whether you want to persist that data, and copy the attributes over to a persistable entity.

As others have answered, to prevent duplication you can use validation rules.