152
Views
4
Comments
Solved
Assigning aggregate results to a list isn't working
Question
Application Type
Reactive
Service Studio Version
11.54.63 (Build 63337)

For the life of me, I can't figure out why this isn't working!

I'm using a data action (GetResultsOtherDeductions) to take data from an aggregate and assign it to an output variable (list) with a table type list (TblAggAuditResultDetail List). Stepping through the data action I can see that the aggregate is working properly and it's getting assigned to the list output variable. I have an after fetch action that assigns it to a local variable with the same type.

However, when I try to reference GetResultsOtherDeductions.list from the after fetch action, it shows the correct number of rows, but they are empty. Sometimes it shows the row detail as unavailable.

I've used this method successfully several times including on the same form. The only difference is this aggregate returns multiple records (4 in my test case) while the others only ever return 1.

I've tried using a structure list instead of a table type list. I've tried changing the data action to a server action and looping through the list and doing a list append to my local list. Nothing works. No matter what I do, the output list isn't available / visible after the data fetch.

Up to this point it's fine. List is getting assigned the proper values.

But the results are blank.

What am I missing here?

I can't provide an OML due to data privacy issues.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi @Jeff Kest ,

OutSystems optimizes for performance, it will only give back the parts of the data that you are actually doing something with (in logic or on screen).  Just assigning a local variable doesn't count.

  • if you do absolutely nothing with it, it would not even give back rows
  • if you only use the length attribute it will give back all rows with no data
  • if you only use the empty attribute, it will give back a single row with no data and length 1
  • if you only use 2 out of 5 attributes of each row in a table on the screen, it will only fill those 2 attributes, etc.

Is that the case here ?

Dorine

2022-12-30 09-46-57
Deepika Patel

Hi,

Verify that mapping is correct when you assign that aggregate to the list.

Thanks!

2024-07-09 06-45-01
Adarsh

Hi @Jeff Kest,

To narrow down the issue inside data action, simply do looping in aggregate and see if data is coming or not, if data is there then check the structure of output variable List, and see if mapping is correct or not.

2024-11-05 11-28-22
Sunil Rajput

Hi @Jeff Kest, 

Dorine Boudry absolutely Correct

 OutSystems optimizes for performance, it will only give back the parts of the data that you are actually doing something with (in logic or on screen).  Just assigning a local variable doesn't count. 

So I have performed a task where I used data action to show a list. By looking at this OML, you can solve your problem. In this, I have used pagination. I retrieved the value from data action, assigned it to a local variable, and displayed it in a table. This might help you 

Folder Name - Test    Screen Name - Pagination 

Thanks

        

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