cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sloughcow
Microsoft
Microsoft

Basic gallery filtering

This seems like such a simple thing to do, but I seem to have it all wrong. I have a SharePoint list called Newsletter Articles. I have a vertical gallery (called LeftNav) that holds a list of all the articles (just the title and the author) that hangs out as navigation on the side of my Power App.
I have another gallery that I've sized to be huge (called DetailedView), and that gallery holds all the article details - you'll see the article title, author, text there, a video recording, etc. etc. I want to be able to select a newsletter article from the LeftNav gallery, and have the DetailedView gallery show the details for just that article. 

Detailed view throws an error with any of these Item specifications: 

Filter('Newsletter articles'.ID,LeftNav.Selected.ID)

Filter('Newsletter articles',LeftNav.Selected.ID)

Filter('Newsletter articles',LeftNav.Selected)

Bonus question - what should my Action be for my LeftNav items? I have a feeling I have that written wrong too...

Thank you in advance for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
jblomberg
Helper II
Helper II

The gallery LeftNav seems fine, but I think the other one shouldn't be a gallery. I may be mistaken, but it sounds like the data shown in DetailedView is all in one record, spread over multiple columns. Galleries work miracles when showing multiple records, but aren't ideal for showing one record only. An edit/display-form seems to be way to go.

 

It's not that you can't do it the way you did it. You can use the LookUp() function for your DetailedView gallery's Items-property and make sure it only shows one record. It's just not the way galleries are designed.

 

The LookUp function would be:

 

LookUp('Newsletter articles', ID = LeftNav.Selected.ID)

 

 

- Joeri Blomberg

View solution in original post

2 REPLIES 2
jblomberg
Helper II
Helper II

The gallery LeftNav seems fine, but I think the other one shouldn't be a gallery. I may be mistaken, but it sounds like the data shown in DetailedView is all in one record, spread over multiple columns. Galleries work miracles when showing multiple records, but aren't ideal for showing one record only. An edit/display-form seems to be way to go.

 

It's not that you can't do it the way you did it. You can use the LookUp() function for your DetailedView gallery's Items-property and make sure it only shows one record. It's just not the way galleries are designed.

 

The LookUp function would be:

 

LookUp('Newsletter articles', ID = LeftNav.Selected.ID)

 

 

- Joeri Blomberg

sloughcow
Microsoft
Microsoft

@jblomberg Thank you! You absolutely read it right that the DetailedView is data from a single record.

I'm using a gallery because I can't seem to get the sort of layout I'd like to have with a display form: it seems like they insist on a vertical structure that lists the data from top to bottom, and I want to organize data from the columns all around the page. You probably guessed that I'm very new to Power Apps and hacking my way around. And your LookUp function worked - thank you!

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (3,769)