cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hpkeong
Community Champion
Community Champion

Useful features of PowerApps (16): Pagination

Hi

 

As Printing feature is not yet released / supported, I have designed a Pagination Features to help customer:

- Page-Up,

- Page-Down,

- Showing total pages and Page No.

so that they can ScreenShot each page for Printing.

 

The key featue is LAST PAGE, where it can show ONLY the remaining rows.

(With normal Gallery Scrolling, the Last Page will encompass Second to Last + Last Remaining rows, and this will confuse customers / users).

 

Hope this may help those interested in Pagination.

Just Sharing.

 

Formula used:

- If, Update Context (for iteration)

- RoundUp, RoundDown (for pages)

- ClearCollect

 

Edit: OnVisible setting.

 Last page... (exact remaining rows showed)Last page... (exact remaining rows showed)

..Pagination with OnVisible..Pagination with OnVisible

hpkeong
1 ACCEPTED SOLUTION

Accepted Solutions
DaveB
Advocate II
Advocate II

That was really useful hpkeong, thanks!

I added to the page:

OnVisible = UpdateContext({ pagesize: RoundDown((Gallery1.Height/Gallery1.TemplateHeight),0), iter: pagesize})

Then substituted 'pagesize' in your formulae.

++1 for reusable macros, PowerApps team???

VOTE FOR MACROS: HERE!

View solution in original post

9 REPLIES 9
DaveB
Advocate II
Advocate II

That was really useful hpkeong, thanks!

I added to the page:

OnVisible = UpdateContext({ pagesize: RoundDown((Gallery1.Height/Gallery1.TemplateHeight),0), iter: pagesize})

Then substituted 'pagesize' in your formulae.

++1 for reusable macros, PowerApps team???

VOTE FOR MACROS: HERE!

View solution in original post

hpkeong
Community Champion
Community Champion

Hi

Thanks for comment and addition.
Yes, I do have OnVisible : UpdateContext...but I forgot to include. Will amend later when on computer.

Anyway, do not forget to append data, using LastN & FirstN.

 

OnVisible:  UpdateContext({iter: RoundDown(Gallery1.Height/Gallery1.TemplateHeight,0)}); LastN(FirstN(Table1, iter), 😎

hpkeong
hpkeong
Community Champion
Community Champion

Hi
Additional features to my sharing:
- user can always drag the gallery to any Height to fit to your screen because it will automatically calculate the total no. Of rows and fit accordingly, calculate the total pages, page no.
- hence it is fully automated.

I wish PG can consider (just as Plug in for jQuery), so that PowerApps user can improve viewing experience without having to rewrite my ideas.

That's is my intention of sharing to enhance PowerApps user friendly environment.
Tw
hpkeong
samsiddiquiz
New Member

It is not working 😕 please help

Abbyj
New Member

Hi,

 

May I know where does the Table1 come from?

 

I see there are a lot of Table1 declaration, but only the item gallery is showing.

 

Thanks,

Aj

Anonymous
Not applicable

Thank you for this awesome post @hpkeong! Could you review @samsiddiquiz and @samsiddiquiz's posts and advised on a suggested solution? 

 

Thanks again!

 

@Anonymous

Hi @Anonymous

To save @hpkeong some time, here are my comments on these 2 posts.

With regard to @Abbyj's question, Table1 refers to the underlying data source that you want to paginate.

With regard to @samsiddiquiz's question, we need more details to explain why it doesn't work. The attached screenshot doesn't show anything meaningful.

It's a nice 'Fake' paging. Be aware that unlike 'real' paging, it load more data than needed to show a page because the use of LastN(FirstN()) formula cannot be delegated so it load all the table.

 

Also, it cannot be used on large tables i.e. > 500 which is the default powerapps limit.

Tejaswini1234
Helper IV
Helper IV

Hello,

I have a searchbox text input field. I have implemented everything you have done. Now I have to search a text based on column in the gallery, But when i am on the next page other than the first page whenever i search for the item it does not take me back to the first page rather it displays blank gallery with total page number as correct one but the current page remains same(old page number) and the searched item is on the first page. So how can i get back to the first page where the item is present.

Thanks in Advance.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,634)