64
Views
4
Comments
Solved
Index out of bounds. Index 0 for empty list. How do I recover?
Question
Application Type
Reactive
Service Studio Version
11.54.61 (Build 63317)

I have a table with a list as its source. I populate the list from the output of a data action and then use the list filter to show only applicable records. When there's records to show, no problem.  However, when the filter returns zero records, I eventually get this error:

I've tried trapping the error right after the list filter method and added a dummy record to the list so it's not empty, but no luck.  It completes the rest of the action, but the moment the action completes, the error pops up. 

Also, after the error comes up, if I set another filter that returns records, they won't show on the table. It's as if the table is broken after the error.

The navigation bar knows there's data, but the table is not visible.

I think it's trying to access the list and it's empty somehow even though I populated it with dummy record.  Even if I try to clear it up, it's too late.

How can I trap and/or reset things before the error comes up and reset the table so it works going forward?

I've read several posts about this error, but I'm having no luck thus far.

2024-02-22 07-37-50
Nikhil Kawde
Solution

Hi @Jeff Kest ,

Looks like you are trying to append a list. But when the filtered list is empty, you simply can not append another list with the empty list as the source. The error that you are getting reflects the same. (The source list has no record at the 0th index)

Thanks,

Nikhil Kawde

 

UserImage.jpg
Jeff Kest

Thanks @Nikhil Kawde.

Your answer started me down the right path to see where I was accessing an empty list. I found it and it wasn't at all where I was expecting it. But because of your answer, I knew enough to look for it.

Thanks again.

2024-05-14 05-39-17
Jothikarthika - EONE

hi  Jeff Kest,

Could you kindly provide the OML file or any relevant images for reference? 

Regards,

Jothikarthika

2024-05-14 06-49-08
Karnika-EONE

Hi @Jeff kest


Can You Please Share the OML Please?


Thanks

Karnika.K


2024-02-22 07-37-50
Nikhil Kawde
Solution

Hi @Jeff Kest ,

Looks like you are trying to append a list. But when the filtered list is empty, you simply can not append another list with the empty list as the source. The error that you are getting reflects the same. (The source list has no record at the 0th index)

Thanks,

Nikhil Kawde

 

UserImage.jpg
Jeff Kest

Thanks @Nikhil Kawde.

Your answer started me down the right path to see where I was accessing an empty list. I found it and it wasn't at all where I was expecting it. But because of your answer, I knew enough to look for it.

Thanks again.

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