cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hpkeong
Level 10

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.

 Screenshot (84).pngLast page... (exact remaining rows showed)

Screenshot (86).png..Pagination with OnVisible

hpkeong
1 ACCEPTED SOLUTION

Accepted Solutions
DaveB
Level: Powered On

Re: Useful features of PowerApps (16): Pagination

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
Level: Powered On

Re: Useful features of PowerApps (16): Pagination

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
Level 10

Re: Useful features of PowerApps (16): Pagination

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
Level 10

Re: Useful features of PowerApps (16): Pagination

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
Level: Power Up

Re: Useful features of PowerApps (16): Pagination

It is not working 😕 please help

Abbyj
Level: Power Up

Re: Useful features of PowerApps (16): Pagination

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

TopShelf-MSFT
Level 10

Re: Useful features of PowerApps (16): Pagination

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

 

Thanks again!

 

@TopShelf-MSFT

Super User
Super User

Re: Useful features of PowerApps (16): Pagination

Hi @TopShelf-MSFT

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.

ezeckiel2517
Level: Powered On

Re: Useful features of PowerApps (16): Pagination

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
Level: Powered On

Re: Useful features of PowerApps (16): Pagination

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
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,485)