cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Filter SharePoint Gallery by values in a table.

I have a gallery on the screen displaying the contents of a document library. I also have a field in a form on the same screen that is associated with a list and has a lookup field to the same document library and also allows multiple values. The value of that lookup field is a table of IDs. I've loaded them in a variable in the event it makes it easier to work with but I'm not sure there's any value in doing that at this point.

 

What I want to do is filter the document library gallery to only show the items that have IDs that match any ID from that field. So for example, if the value of the field has a table with values 3,5,8,11 I want to only show the documents in the gallery that have an ID that matches one of those values.

 

The context is a case where I can't use list item attachments and I need to allow for associating documents with a list item. The lookup works OK in that you can type in the filter to narrow results. However when you display it just gives static text of the title and no clickable link for the document. By adding a gallery I'm hoping it'll be easier to view the associated documents.

 

Thanks very much in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter SharePoint Gallery by values in a table.

Hi @dev709 ,

 

Did you mean that it's a multiple-values enable lookup column? If so, then please insert a Radio control in the data card instead and set its Items property to:

Filter(Library1,ID in DataCardValue17.SelectedItems.Value).'Link to item'

OnSelect property to:

Filter(Library1,ID in DataCardValue17.SelectedItems.Value).'Link to item'

 

DataCardValue17 is the combo box control for the multiple-valued lookup column.

 

This work for me:

Capture.JPG

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Filter SharePoint Gallery by values in a table.

Hi @dev709 ,

 

Since your purpose is to show the link of the document that the lookup column in SharePoint list is associated to, then instead of showing the document links in a gallery, you can actually achieve this inside each list items' form control.

 

In my SharePoint list, I have a lookup column called LookupLibrary which source is a library and the value is from the library's ID field. In PowerApps Form control, this field display as a dropdown control like below. Select this data card, unlock it and insert a Label control. Set the Text property of Label1 to:

LookUp(Library1,ID=DataCardValue16.Selected.Value,'Link to item')

Library1 is the source library's name, DataCardValue16 is the dropdown control's name for the lookup field.

Capture.JPG

 

Then if you can hide the dropdown control by setting its Visible property to false. And you can also make this link clickable, by setting the OnSelect property of the Label1 to:

Launch(LookUp(Library1,ID=DataCardValue16.Selected.Value,'Link to item'))

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
New Member

Re: Filter SharePoint Gallery by values in a table.

Thanks for the reply. It does retrieve the URL value but unfortunately it seems like it only does it for the first item. There could be multiple items associated. Unless I'm doing something wrong?

 

I managed to get the gallery to work, but unfortunately it was using "in" so I get the delegation warning.

 

Filter('Document Library', ID in DataCardValue5.SelectedItems.Id)

 

 

Highlighted
Community Support
Community Support

Re: Filter SharePoint Gallery by values in a table.

Hi @dev709 ,

 

Did you mean that it's a multiple-values enable lookup column? If so, then please insert a Radio control in the data card instead and set its Items property to:

Filter(Library1,ID in DataCardValue17.SelectedItems.Value).'Link to item'

OnSelect property to:

Filter(Library1,ID in DataCardValue17.SelectedItems.Value).'Link to item'

 

DataCardValue17 is the combo box control for the multiple-valued lookup column.

 

This work for me:

Capture.JPG

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
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

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,853)