SEARCH A OBJECT INSIDE A LIST

0
Good Morning, How a create a verification to see if a Object already exists inside a List?   A have a flow which need to verify if the Nr of a Previsao already exists inside de DB.   A have something like that going on, but have no ideia how to execute properly.  
asked
3 answers
0

You may find it easier to use a the Find list operation on your list to look for a matching object. This will return either one matching object or empty if there is no match.

 

https://docs.mendix.com/refguide/list-operation/#member-inspections

 

I hope this helps. Good luck!

answered
0

Hi Tiago,

 

As Robert already mentioned, you can use the 'List operation' activity to Find a specific instance in a list. In the example below, it tries to find an instance of RequiredDocument in the retrieved list that has DocumentId '123456'. If there is a document with that ID in the list, it will return it. If not, it will return empty.

 

image.png

answered
0

Hi Taigo,

 

Retrieve your list -> use list operation activity -> inside list operation select find -> select any member (you want to find on the basis of that member) -> inside equals section pass your $currentObject/member_Name(if you want dynamically) otherwise give static value.

answered