cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
teaful
Helper I
Helper I

CANVAS APP: Show document library contents (files) based on URL to that folder in SharePoint list

I have a gallery connected to a SharePoint list named Clients. Within this list, there is a column [Type: Hyperlink] with a link to the client's folder living at [Documents/General/Library-Clients/[client name here] ].

 

I cannot seem to figure out how - when a client is selected in the gallery - to have their files show up in a gallery/or... below their data detail. Can someone lead me in the right direction perhaps? Screenshot attached.

 

The folder link is in a column called 'Client Folder' in the screenshot.

 

16 REPLIES 16
v-bofeng-msft
Community Support
Community Support

Hi @teaful :

I'm not sure if I understand what you mean correctly, please help me point it out if there is an error:

  • There is a Hyperlink column named "Client Folder" in your SP list.
  • The value in The Hyperlink column is the value of "'Link to item'" of the file in Library.Some thing like:

 

https://xxxx.sharepoint.com/sites/sitesname/libraryname/folder1/folder2/filename

 

  • You want to get a preview of the file through the Hyperlink column and display it.

If so,You can find the specified file in the library through lookup, and then call its Thumbnail property to get the thumbnail of the file.I'v made a test for your reference:

1\My SP list

1.JPG

2\My Library-picc

3\Add a gallery and set it's items property to:

 

ListA

4\Add a image control into  this gallery and set it's Image proeprty to:

LookUp(picc,Text(ThisItem.'Client Folder') in 'Link to item').Thumbnail.Medium

The Result:

3.JPG

Best Regards,

Bof

 

teaful
Helper I
Helper I

@v-bofeng-msft , The link is actually to a FOLDER rather than an individual file. In my PowerApp, I have the need to display the contents of a folder based on the client chosen in a gallery. 

 

the attached pic highlights what needs to happen. when clicking on a client, their details come up. The field you see called "Client Folder in Document Library" should have it's contents displayed in the attachments section. (Attachments is only there as a placeholder for now)

v-bofeng-msft
Community Support
Community Support

Hi @teaful :

Do you mean "Client Folder" is a link to a folder?Something like:

https://XXXX.sharepoint.com/sites/SitesName/LibraryName/Folder1/Folder2

If so,please try this solution:

1\Add a gallery(Gallery4) and set it's items property to:

ListA

2\Add a gallery(Gallery3) and set it's Items property to

Filter(picc,Gallery4.Selected.'Client Folder' in '{Link}',!IsFolder)

3\Add an image control into Gallery3 and set it's image property to

ThisItem.Thumbnail.Large

38.gif

Best Regards,

Bof

I'm getting an error unfortunately. I even tried creating a new 'client folder' column that was text only, but ended up getting the same error. (attached). Could it have anything to do with the fact that my folder is nested 3 deep within Documents?

v-bofeng-msft
Community Support
Community Support

Hi @teaful :

The key is that the library is cited incorrectly. Because the name contains the special character "-", you can try to use ‘library-xxx’ to refer to this library.Something like:

 

Filter('Library-xxx',xxx in xxx)

 

Best Regards,

Bof

teaful
Helper I
Helper I

Thank you v-bofeng! I'm glad to learn about the dash in a file name and the need for quotes.

 

After adding the single quotes though, I received a different error saying that the item doesn't exist. Does this formula/process automatically search the "Documents" library that I have added as a connection, or do I need to put in the full path to the exact folder I need?

v-bofeng-msft
Community Support
Community Support

Hi @teaful :

Have you added this library as a data source?

1.JPG2.JPG

Best Regards,

Bof

teaful
Helper I
Helper I

Yes, I've connected to the parent folder called "Documents". The folder 'Library-Clients' lives WITHIN "Documents".  I can't seem to connect to anything but the parent folder. Should I be able to make a direct connection with Documents/General/Library-Clients?

v-bofeng-msft
Community Support
Community Support

Hi @teaful :

Could you give me some screenshots?

Best Regards,

Bof

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (36,279)