cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VilPel
Helper II
Helper II

Displaying Lookup data in a gallery after selecting an item

Hello Power Users, I'm struggling a little bit trying to implement this idea in my application.

 

I have 2 SharePoint lists, Courses and Books as shown below.

courses.pngbooks.png

In the courses list I'm using a lookup column that retrieves data from the Books list. Keep in mind that a course can have multiple books so the column has been set to accept multiple values.

 

Now the thing I want to do is that when I open a course item in Power App, I want to display the books of a course in a gallery, where I have also included the book descriptions and the ratings as shown below.

details.png

Any help to achieve this? I managed to do it with labels when my lookup column only accepted a single value with: 

LookUp(Books, ID=Gallery1.Selected.Courses.Id).Title and so on. Now I my lookup column accepts multiple values and I can't find a way to fix my code to display the books in a gallery as shown above.

 

Thank you in advance,

 

Ville

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@VilPel 

Assuming that you are using a Gallery to display the list of books for the Course, set the Items property of that Gallery to:

   Filter(Books, ID in Gallery1.Selected.Coursed.Id)

 

Now you will have the data for the gallery and can add labels to the Gallery that display the book information.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@VilPel 

Assuming that you are using a Gallery to display the list of books for the Course, set the Items property of that Gallery to:

   Filter(Books, ID in Gallery1.Selected.Coursed.Id)

 

Now you will have the data for the gallery and can add labels to the Gallery that display the book information.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

VilPel
Helper II
Helper II

Huge thanks to you Randy! It works fine now 🙂

VilPel
Helper II
Helper II

Hi @RandyHayes, thanks for your help yesterday. I have one follow-up question regarding to this case. Let's say I want to add more books to this related course with a title, description and rating. I'd have a button on the details page that opens a form where you can add a new book to the course as shown below.

details2.pngform.png

How do I add this new book directly to the gallery that's displaying on the details page using this form and the submit button? And a bonus question for you, how do I edit and delete items from this gallery with buttons?

 

Thanks,

 

Ville

RandyHayes
Super User
Super User

@VilPel 

This is not a problem. However you will have to not only Submit the form to create the Book, but then you will need to Update the lookup column in your Course list to include that book.

As for editing the book...that is going to be something you would do with the edit form as you are only editing the data from the Book list.  So a simple edit and submit would be fine.

For deleting, you would need to again update the Course lookup column to remove that reference.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,357)