How to implement IN clause in aggregates? | Outsystems
Application Type

I've 2 different lists which are coming from different aggregates and I want to compare these list items to the other aggregate. How can I do it without the use of SQL?


Hi Abhishek,

can you share more, your datamodel and the 2 aggregates, and how the data in your first aggregate relate to the data in your second aggregate.

So as to understand what you are doing.  I would expect that you can do all in 1 aggregate with joins, rather than read part of the data and then try to filter a second aggregate with results of the first.


Hi Abhishek,

you create a string list for the 1st aggregate using a String_Join and apply that list in the 2nd aggregate.

Check this topic for more details:



Hi Abhishek, 

If it's not possible to do this in an Aggregate or SQL, what you would typically do is make sure they are sorted the same way, and then traverse both lists using indexing (so using e.g. MyList[Index1]), comparing the two and increasing one or both indexes depending on how they compare.

Alternatively, if they are relatively small lists, you could For Each over the largest list, and use a ListAny or ListIndexOf to search if an identical record exists, although without additional bookkeeping you won't find records that are in the 2nd but not the 1st list this way.

Btw, the title of your post is not what your question seems about, perhaps edit it?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.