web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter with Index func...
Power Apps
Unanswered

Filter with Index function throw error

(0) ShareShare
ReportReport
Posted on by 1,115

I earlier used Index function to filter a collection or gallery with multi select values from a combo box without any issue. Today I have noticed this weird error while using the same index function. 

The second argument to the 'Index' function must be between 1 and 1, the lower and upper bounds of the table. The upper bound may be reduced due to the non-delegation limit.

Here is my code at OnChange property of my combo box. My 'Project Type' column is a single line of text column in my data source.

 

ClearCollect(
 colPLEWebTemp,
 Filter(
 'PVRT Metrics List',
 And(
 Division = cmb_Filtr_Division.Selected.Title,
 Department = cmb_Fltr_Dept.Selected.Title,
 Or(
 IsEmpty(Self.SelectedItems),
 IsBlank(Self.SelectedItems),
 'Project Type' = Index(
 Self.SelectedItems,
 1
 ).Title,
 'Project Type' = Index(
 Self.SelectedItems,
 2
 ).Title,
 'Project Type' = Index(
 Self.SelectedItems,
 3
 ).Title,
 'Project Type' = Index(
 Self.SelectedItems,
 4
 ).Title,
 'Project Type' = Index(
 Self.SelectedItems,
 5
 ).Title
 )
 )
 )
);

The combo box items property has 

SortByColumns('Project Types List',"Title")

 

Has anything changed recently with respect to this function or related areas. Kindly help what could be done here?

Categories:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @RameshMukka ,

     

    The way "Index()" works, it looks for the Nth record in the collection. If your collection has less than 5 items, it won't be able to retrieve an inexistant 5th item, thus returning the error.

     

    One way you could maybe fix it is checking if the "Project Type" exists in the table of selected items from your combobox.

     

    ClearCollect(
     colPLEWebTemp,
     Filter(
     'PVRT Metrics List',
     And(
     Division = cmb_Filtr_Division.Selected.Title,
     Department = cmb_Fltr_Dept.Selected.Title,
     Or(
     IsEmpty(Self.SelectedItems),
     IsBlank(Self.SelectedItems),
     'Project Type' in Self.SelectedItems.Title
     )
     )
     )
    );

     

  • rameshmukka Profile Picture
    1,115 on at

    @WiZey Thanks for the clarification. However Index function helps to deal with the delegation problem. "in" operator brings me delegation issue. My list is going to have more than 2000 items. Is it achievable?

  • WiZey Profile Picture
    3,023 Moderator on at

    Yes, you can store your records in a local collection, thus removing the delegation warning.

     

    1st: Collect(collection, datasource)
    
    2nd: Filter(..., status in collection.column)
  • rameshmukka Profile Picture
    1,115 on at

    @WiZey  Isn't the "in" operator here causing the delegation problem? I have to check the column value in the combobox selected items. As long as I have "in" operator, I will have delegation problem.

  • joe-mv Profile Picture
    2 on at

    @RameshMukka - Did you ever find a solution to this problem and overcome Delegation?

  • jpullins1 Profile Picture
    on at

    Were you able to resolve this issue? My filter literally just stopped working, claiming to have the same issue. 

  • rameshmukka Profile Picture
    1,115 on at

    @jpullins1 

    There is an old method of doing it. Reza Dorrani described both methods here. Please check it out. I had to use old method to get around the issue.

    https://youtu.be/Wr42PeW6_wU 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard