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

Issue using a Gallery to display files in a Sharepoint Document Library

Hi I am having sharepoint list customized form.
Trying to simply show files from document library in a gallery.

Items property: Filter('Supplier Documents',SupplierRefID=myid)

SupplierRefID = Text field storing the reference id of supplier.

 

When we hardcode the myid with some number in the dev studio, files are shown properly. I am just displaying Title & created date.

When we publish and try to run in browser, the gallery does not show anything. just blank.

 

Please help if any idea.

1 ACCEPTED SOLUTION

Accepted Solutions

Ok @Anonymous ,

So you have a field in your List called SelectedListItemID which is Numeric and a Text version of this is stored in your Library in field called SupplierRefID?

So the Filter on your Library could be

Filter(
   'Supplier Documents',
    Value(SupplierRefID)=SharePointIntegration.SelectedListItemID
)

On this subject, why have you stored SupplierRefID as Text? Making it Numeric would save all this conversion.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You can do this a number of ways - the easiest if you have selected the item from a gallery is

Filter(
   'Supplier Documents',
    SupplierRefID=YourGalleryName.Selected.SupplierRefID
)

If you set the Variable (Global) myID at the point your know it, then your code should certainly filter the gallery.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

@WarrenBelz,

Yes the code should certainly filter the gallery but it is not. The Id to be compared is nothing but 

SharePointIntegration.SelectedListItemID

Hence I am using this same ID by converting to Text(). 
The gallery is displayed on the view form, inside a custom data card. All other data is getting displayed using same ID. 
My basic question is if its filtering on the dev. screen, then after publishing why its showing a blank gallery. Am I missing anything here?

OK @Anonymous ,

A bit more information so I understand your setup - please confirm if my assumptions below are correct

  • You have a Power Apps SharePoint Integration form based on a SharePoint list.
  • You have a SharePoint Document Library called 'Supplier Documents' and in the metadata is a Text field called SupplierRefID which is a number stored as text and matches a field in the list (which I assume is numeric).
  • In a custom card in the form, you have a gallery based on 'Supplier Documents'  in which the Items need to be filtered to reflect where the field SupplierRefID matches the relevant field in your list.
  • When you hard-code myid as a text value, the filter works.

So assuming that the value of myid is available in the List form as a number in the field SupplierRef (change to your name) and the form has been selected from a gallery, you can set myRef on the OnSelect of the gallery.

Set(
   MyRef,
   YourGalleryName.Selected.SupplierRef
)

assuming this is numeric, your filter would be

Filter(
   'Supplier Documents',
    Value(SupplierRefID)=MyRef
)

Are my assumption correct?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

Thanks @WarrenBelz  for immediate reply. 

 

First 3 points are right. Fourth point - yes in development studio (browser), when I hard code the variable, it shows the files. 

 

Form is not selected from gallery. The item is selected in sharepoint and we click on "Open" to view this item. So MyRef will be set as: 

Set(MyRef, SharePointIntegration.SelectedListItemID);

And the "Supplier Documents" is filtered directly using this variable as: 

Filter(
   'Supplier Documents',
    SupplierRefID=Text(MyRef)
)

 

When we publish this code and try to load the form, it does not show anything. 

Ok @Anonymous ,

So you have a field in your List called SelectedListItemID which is Numeric and a Text version of this is stored in your Library in field called SupplierRefID?

So the Filter on your Library could be

Filter(
   'Supplier Documents',
    Value(SupplierRefID)=SharePointIntegration.SelectedListItemID
)

On this subject, why have you stored SupplierRefID as Text? Making it Numeric would save all this conversion.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

SelectedListItemID is not a column. Its property provided by SharePointIntegration connector to fetch us the current item selected on SP. 
So, instead of converting RHS to text, converting LHS to number format worked. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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