cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Is it possible to restrict Gallery to show only 1 record

Is it possible to restrict Gallery to show only 1 record?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Re: Is it possible to restrict Gallery to show only 1 record

I'll break it down for you.

 

FirstN will retrieve the first N records. E.g. FirstN(source,15) will return the first 15 records in source.

 

Last will retrieve the last record. e.g. Last(source) might return you (for example) row 30...

 

By using these together like so 

 

Last(FirstN(source, number))

 This will get the last record from the firstN records. So TLDR; the number you put there is what row will be given back in return.

 

Sean

View solution in original post

5 REPLIES 5
Highlighted
Power Participant
Power Participant

Re: Is it possible to restrict Gallery to show only 1 record

That is possible, just adjust the gallery's Items property to select just one record, for instance with a call to Filter.

 

You might want to use a form instead of a gallery, since it's probably a better solution for showing a single record.

Highlighted
Community Support
Community Support

Re: Is it possible to restrict Gallery to show only 1 record

Hi Raynold,

 

You may consider to filter the gallery to show the records.
https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

 

Or you could also consider to use First/FirstN function to return first or first set of records of a table on a gallery.
https://powerapps.microsoft.com/en-us/tutorials/function-first-last/

 

Please try it on your side.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Is it possible to restrict Gallery to show only 1 record

Hi Mabel,

 

Could you please give the syntax on using the First/FirstN function to return first or first set of records of a table on a gallery.

 

Thanks!

Highlighted
Continued Contributor
Continued Contributor

Re: Is it possible to restrict Gallery to show only 1 record

Last(FirstN(source, number))
Highlighted
Continued Contributor
Continued Contributor

Re: Is it possible to restrict Gallery to show only 1 record

I'll break it down for you.

 

FirstN will retrieve the first N records. E.g. FirstN(source,15) will return the first 15 records in source.

 

Last will retrieve the last record. e.g. Last(source) might return you (for example) row 30...

 

By using these together like so 

 

Last(FirstN(source, number))

 This will get the last record from the firstN records. So TLDR; the number you put there is what row will be given back in return.

 

Sean

View solution in original post

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,969)