60
Views
8
Comments
Solved
Unable to access data from a list or Aggregates Using Index values .
Question
Application Type
Reactive

Hello all

I am trying to access elements of an aggregate using inex values so as to form a table on screen. But i am getting errors related to Index out of bound.

I have attached OML for your reference.

Please suggest whati can do.

Regards

ColomnTransDemo.oml
2025-04-30 07-30-15
Sanjay Bankar
Solution

Hello Team 

I Analyzed my issue in application carefully and got know that while trying to access list elements using index values i was getting error related to "Index Out of Bound"

And it was happening because i was trying to fetch values which are not exist in list on screen using indexes.

So simply what i did is i put that table where i am fetching values in a container and applied "not IsDatafetched" property of list to Visibility of that container.  That means Container and Its table will be displayed on screen only when there is data fetched in List.


Thanks for your Help and time.

Regards.




2025-12-15 09-29-24
Thibaut G

the module is under intellectual property protection so i can't publish it on my environment to test.

2025-04-30 07-30-15
Sanjay Bankar

What can i do then in this case? Please suggest.

2025-12-15 09-29-24
Thibaut G

I don't know how we can fix this.

Regarding your expressions, you can try to add this for each expression.
You should adjust the count for each expression.
Is it possible that the reason for the error is that the GetStudents aggregate holds less then 11 records?

2025-04-30 07-30-15
Sanjay Bankar

Thank you Let me explain my issue in depth.

I have one entity as below


And i want above table in below format

there are two rows below 


1st row (MinMarks - MaxMarks) - index-wise

2nd row (Marks) - indexwise


In short i want to convert Table to Two Rows table.

Thanks.

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi! 

I believe your code is missing an "if" 

for instance  in the third expression you have:

GetStudents.List[2].Student.MinMarks + " - " + GetStudents.List[2].Student.MaxMarks

to avoid errors you should have something like :

If( GetStudents.List .count > 2 , GetStudents.List[2].Student.MinMarks + " - " + GetStudents.List[2].Student.MaxMarks, 0)

Hope this helps  

Graça


PS 

by the way , second expression is probably not correct

 

2025-04-30 07-30-15
Sanjay Bankar

Thank for response can you please tell me if all other expressions are correct.

2018-06-05 16-54-03
Maria da Graça Peixoto

in the 2ª expression you have :

GetStudents.List[1].Student.MinMarks + " - " + GetStudents.List[2].Student.MaxMarks 

it is not consistent with the expressions in the expressions in the other cells. 

Just that 

Regards 

2025-04-30 07-30-15
Sanjay Bankar
Solution

Hello Team 

I Analyzed my issue in application carefully and got know that while trying to access list elements using index values i was getting error related to "Index Out of Bound"

And it was happening because i was trying to fetch values which are not exist in list on screen using indexes.

So simply what i did is i put that table where i am fetching values in a container and applied "not IsDatafetched" property of list to Visibility of that container.  That means Container and Its table will be displayed on screen only when there is data fetched in List.


Thanks for your Help and time.

Regards.




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