How to use for each loop for fetching data to iterate list of records in an entity?


How to use for each loop for fetching data to iterate list of records in an entity? I am facing problem in fetching the list of records which exists? Here i need to fetch values in the record which exists in the record  Entity consists of these attributes (date, Task1, Task2) based the date i need to fetch the remaining attribute values(Task1, Task2).       

 date           |           Task1     |  Task2

04-26-2019 | work on demo  | work on the task

05-24-2019 | work                 | work on demo 

If the value of date matches with date in the entity it should fetch the attribute values Task1 and Task2.

For each loop is not working properly. can anyone help me with this?

Hello Swetha,

Care to explain with more details how is your data model, where comes from the "date" you are using to compare, and what you are trying to do exactly? 

Why not filter the Aggregate based on your date?

Something like:

YourEntityName.Date = Date

And the aggregate will return only the records for that date?

P.S. On both branches you are navigating away from the screen and going back to it, so the page will be completely reinitialized and any changes you made to local variables will be lost, as well as any aggregates set to be fetched at start will execute again.

Hi Swetha,

As Eduardo already pointed out you need to use an aggregate to fetch the data and filter the entity date attribute with the date on your form.

Again as with your previous questions, these are the basics of OutSystems that you learn when doing the training.

The fun part of learning OutSystems by following some training is that you learn the platform step by step.

The approach you now have, in my mind is counterproductive, you try yourself, not knowing how to do it, then you need help from someone, to fix what does not make sense. 

I personally didn't follow any classical training, all I know I learned following the online training classes, they are great! You should really try it. It makes building applications so much easier and more fun!