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 / Splitting up records a...
Power Apps
Answered

Splitting up records among Galleries

(0) ShareShare
ReportReport
Posted on by 1,088

Let's say I wanted Gallery1 to have records 1-6... no problem, FirstN.

 

But let's say I have three galleries and first one I want 1-6 and second 7-12 and third 13-18.  That way no scroll bars, everything on separate galleries.  Alost like one big dashboard.

 

How would I do that?  Is there a different command where I could break out records like that into separate tables?

 

Thanks,

Terry

Categories:
I have the same question (0)
  • leyburn19 Profile Picture
    2,157 on at

    Are your number of records fixed.  If so just three collections based on the item ID:

    Something like.

    ClearCollect(list1,Filter(source, ID <=6)); ClearCollect(list2,Filter(source, ID >6 And ID <=12)); ClearCollect(list3,Filter(source, ID >12))

     

    If your records numbers are not fixed then maybe you need to create a number of variables based on the record count

     

    Set(CountAll,Countows(Sorce))

    Set(layer1,CountAll/3); ClearCollect(List1,Filter(source, ID <=Layer1));

    Set(Layer2, Layer1 *2); ClearCollect(List2,Filter(source, ID >Layer1 And <=Layer2));

    ClearCollect(List3,Filter(source, ID >Layer2));

     

  • Verified answer
    WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Mattw112IG ,

    First one you have - second would be

    FirstN(
     Filter(
     Sort(
     YourDataSourceName,
     YourSortOrder
     ),
     Not(ID in FirstGalleryName.AllItems.ID)
     ),6
    )

    and the third

    FirstN(
     Filter(
     Sort(
     YourDataSourceName,
     YourSortOrder
     ),
     Not(ID in FirstGalleryName.AllItems.ID) && 
     Not(ID in SecondGalleryName.AllItems.ID)
     ),
     6
    )

    Note there is a delegation issue with both Not and In, but I had these working fine on a collection.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Mattw112IG ,

     

    Please try this:

    1. First to save the First 6 records, Frist 12 records, and First 18 record to collections.

    2. Remove the first 12 records(Col1_12) form the first 18 records(Col1_18), then you can get the records from 13-18.

    3. Remove the first 6 records(Col1_6) from the first 12 records(Col1_12)l, then you can get the records from 7-12.

     

     

     

    ClearCollect(Col1_6, FirstN('Data Source',6));ClearCollect(Col1_12, FirstN('Data Source',12));ClearCollect(Col1_18, FirstN('Data Source',18));
    ClearCollect(Col13_18, Remove(Col1_18,Col1_12));
    ClearCollect(Col7_12, Remove(Col1_12,Col1_6))

     

     

     

    Then, Col1_6, Col7_12, and Col13_18 are what you want. Try to put the above code to OnStarts property or OnVisible property, and set Col1_6, Col7_12, and Col13_18 to each Gallery Items property.

    Hope this helps.

    Sik

     

  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Mattw112IG ,

    Some options for you here - probably all will work - I have tested mine, although you will have to collect to avoid delegation issues.

    Please tag whichever option best suits you to continue the thread.

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 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard