Verify unique attribute

0
Hello Experts We have scenerio where we upload JSON file and use import mapping to get list of objects. Now we need to check uniqueness of ID before committing to database. How can we do that? 
asked
3 answers
1

If this needs to be done for every new object, regardless by importmapping, or any other create-activity, then add an After-Create-event-microflow to that entity. Use that microflow to check if the newly created object's values are unique, and do your thing.
If this check should only be done at the importmapping, than either use Steffy's suggestion, or at the importmapping use the option ‘microflow’ to obtain the new object:

answered
0

You could try adding a Unique validation rule to the relevant attributes. That would prevent Mendix from committing if the value already exists.

For more on how this works have a look at this page in the documentation.
https://docs.mendix.com/refguide/validation-rules/#uniqueness

Hope this helps.

answered
0

Hi Aditya,

 

Create new list and iterate your JSON list of objects through loop.

 

  1. First iteration, u add the first object from JSON list to new list
  2. From second iteration onwards, before adding to new list check whether the same object is already there in the new list which you created.
answered