cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ShanP
Level: Powered On

Total amount of items in gallery

User enters data on a from that will be displayed on a gallery. I have one input box named "ID" and I would like that input to be auto filled with the total amount of items in the gallery + 1. Is there a way to call the total amount of items in the gallery?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

Re: Total amount of items in gallery

You can use CountRows to get the number of items.

 

To get the number of items in gallery put the same formula in the CountRows() like you have in Gallery.Item

 

For example in gallery Item you have this forumla:

 

Filter(DataSource,Name = "Martynas")

To get the number of items in this gallery you would use:

CountRows(Filter(DataSource,Name="Martynas"))

The output of CountRows is number 

View solution in original post

Meneghino
Level 10

Re: Total amount of items in gallery

HI @ShanP

@Anonymousis correct in his suggestion, but a more efficient formula that avoids an extra call to the database is this:

CountRows(Gallery1.AllItems)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Re: Total amount of items in gallery

You can use CountRows to get the number of items.

 

To get the number of items in gallery put the same formula in the CountRows() like you have in Gallery.Item

 

For example in gallery Item you have this forumla:

 

Filter(DataSource,Name = "Martynas")

To get the number of items in this gallery you would use:

CountRows(Filter(DataSource,Name="Martynas"))

The output of CountRows is number 

View solution in original post

Meneghino
Level 10

Re: Total amount of items in gallery

HI @ShanP

@Anonymousis correct in his suggestion, but a more efficient formula that avoids an extra call to the database is this:

CountRows(Gallery1.AllItems)

View solution in original post

LearnDevil
Level: Powered On

Re: Total amount of items in gallery

both suggestions work but the latter one only works first time For me.

If i want to make a change to my filter using a radio button for example, then i need to re-query the database each time to to get the countrow answer.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,457)