how can i use for each on specific attribute

hello

how can i use for each on specific attribute (To check for a specific record in it)

thanks

Hello.

I think you are mixing the terms. You want to do a for each on a list of records to search for an attribute.


Doing a For Each manually is a waste of time and resources. OutSystems has ways of doing it for you.


If the records are in an entity you can query, you do a query filtering by such attribute

https://www.outsystems.com/learn/courses/126/aggregates-101/

If the records came from a webservice or other type of striuctured list, you use ListIndexOf function.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#ListIndexOf


Hi!

Also, you can use ListFilter to filter for a specific condition:
https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#Listfilter


BR,

Luis

Hi Rashed,

Please find the below screenshot for reference.

you can use if block after the for each loop and inside your If condition, you can choose any attribute belong to that list and you can take action upon it.


Regards,

Manish Jawla

HI Rashed,


You can try below too.

Hi folks,

despite all the good answers above.
I would like to go with the ListAny - the cleaner one with a Boolean Result.

ListAny :

- > SourceList

- >Condition 

<- Boolean Result


https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/System_Actions#ListAny