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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The first argument to ...
Power Apps
Unanswered

The first argument to Sequence must be between 0 and 50.000

(0) ShareShare
ReportReport
Posted on by 26

Hi!

 

I'm building a Power App to handle leave requests for my company. My app uses a Microsoft List as a database (I know it's not the best approach) where all the requests are stored there. The columns in the list are: Employee (Office365 profile), Start (Date), End (Date), RequestType (choice) and Status (choice). I have a gallery that fetches information from the list, filters only the entries from the current user that has days in the current year and displays it. Most of the information displayed in each gallery card are directly fetched from the entry in the Microsoft List. However, one label counts the number of weekdays between the start date and the end date that fall within the current year. I have tested with several combinations and everything has worked as expected, but I anyways get the error "The first argument to Sequence must be between 0 and 50.000" when refreshing the Microsoft List. I have been commenting out fields and pieces of code to figure out where the error is coming from but so far I haven't succeeded. Here is a screenshot of the app for completeness:

image.png

 

The error happens exclusively when pressing on the "My leave requests" which refreshes the Microsoft List.

 

Here is the code for the Items property of the gallery:

 

 

 

If(
 IsBlank(SelectedRequestFilter),
 Filter(
 'Holiday tracker', //SortByColumns('Holiday tracker', "DateRequested", SortOrder.Descending),
 StartsWith(
 Employee.DisplayName,
 User().FullName
 ),
 End >= Date(Year(Today()), 1, 1)
 ),
 /*Filter(
 Filter(
 'Holiday tracker',
 Status.Value = SelectedRequestFilter
 ),
 StartsWith(
 Employee.DisplayName,
 User().FullName
 ),
 End >= Date(Year(Today()), 1, 1)
 )*/
 Filter(
 'Holiday tracker',
 Status.Value = SelectedRequestFilter,
 StartsWith(
 Employee.DisplayName,
 User().FullName
 ),
 End >= Date(Year(Today()), 1, 1)
 )
)

 

 

 

The SelectedRequestFilter comes from the three buttons above the gallery and is empty if no filter is selected.

 

Thanks in advance!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @JoelAle ,

     

    Can you please share the formula that contains the Sequence function? The one you shared does not contain this function, so this is not what is causing the error, at least not directly.

  • JoelAle Profile Picture
    26 on at

    Apparently this issue was related to another gallery that didn't have anything to do with this component, but galleries refetch elements when the source is refreshed.

  • JoelAle Profile Picture
    26 on at

    I found the problem and it was located in a new gallery I was working on. Removing that gallery fixed the problem.

     

    Thanks anyways.

  • JasonZF Profile Picture
    572 on at

    I'm happy you have solved the issue, however I have a suggestion on how to simplify the formula in your items property. I've utilized this approach a lot when a control that is to filter can also be blank, not applying a filter. Since the boolean argument within the Filter() function always tries to return true, you can add your initial test as an OR statement (double || pipe).

     

    Filter(
    	'Holiday tracker',
    	Status.Value = SelectedRequestFilter || IsBlank(SelectedRequestFilter),
    	StartsWith(
    		Employee.DisplayName,
    		User().FullName
    	),
    	End >= Date(Year(Today()), 1, 1)
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard