web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to see Sharepoint ...
Power Apps
Answered

how to see Sharepoint subfolders files in the gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Everyone

I have a sharepoint link with me which contains sharepoint folder
eg: 
folder a,
folder b,
folder c,

and within these folders I have some Word file and PPT
folder a, -> a.ppt
folder b, ->b.ppt
folder c, ->c.ppt

Now in Canvas app I have took a gallery and connected to the Sharepoint link 
I am able to see all the folders and files in the gallery.
I have also added a icon
icon-> On Select ->If(ThisItem.IsFolder,Set(VariablePath,ThisItem.'Full Path'&"/"),Launch(ThisItem.'Link to item',Blank(),LaunchTarget.New))

I want to show all the files(a.ppt,b.ppt,c.ppt) and not the folders in the gallery

It will be really helpfull if some can help me out.

Thanks in advance

Categories:
  • Verified answer
    v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Here is a test for your reference:

    Here is folder

    vchengfenmsft_0-1666776764972.png

     

    1. Write this code in the OnStart property of the App:
    Set(varFolderPathCurrent, "excel/")

    vchengfenmsft_1-1666776764975.png

     

     

    1. Write this code in the items property of the Gallery1:
    SortByColumns(Filter(excel,'Folder path'=varFolderPathCurrent),"{IsFolder}",Descending,"{Name}",Ascending)

    vchengfenmsft_2-1666776764981.png

     

     

    3.Restart App

    vchengfenmsft_3-1666776764983.png

     

    4.Add a Icon ,

    Write this code in the OnSelect property of the icon:

    If(

        // checks whether the gallery item is a folder or file

    ThisItem.IsFolder,

        // get the current location for the selected folder

    Set(varFolderPathCurrent,ThisItem.'Full Path'&"/"),

        // open the file a new browser tab

    Launch(ThisItem.'Link to item',Blank(),LaunchTarget.New))

     

    Write this code in the Icon property of the icon:

    If(ThisItem.IsFolder, Icon.Folder, Icon.DocumentWithContent)

    vchengfenmsft_4-1666776765000.png

     

    Write this code in the text property of the Label:

    ThisItem.'File name with extension'

    vchengfenmsft_5-1666776765005.png

     

    Here is result

    vchengfenmsft_6-1666776765022.png

     

    Here is a link for your reference:

    Power Apps Navigating Folders & Subfolders In A SharePoint Document Library (matthewdevaney.com)

     

    Best Regards

    Cheng Feng

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @v-chengfen-msft 
    Thank you so much for your reply
    My problem is solved

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard