You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is impossible to load the files or folders that are created under a Teams channel. It is also impossible to create new folders or files
Describe the solution you'd like
I'd like to load the files or folders under a team channel by using channel.LoadAsync(f => f.Files) and channel.LoadAsync(f => f.Folders) respectively.
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Hey @timdelavoorde , files and folders in a Teams channel actually live in the default document library of the SharePoint site connected to the Team, by default the default folder is the "Shared Documents" folder and each channel has it's own folder in that library (the channel displayname). So using below approach you can get to the folder hosting the files for the channel:
varteam=await context.Team.GetAsync(o => o.Channels);varfolder=await context.Web.GetFolderByServerRelativeUrlAsync($"{context.Uri.PathAndQuery}/Shared Documents/{team.Channels.AsRequested().First().DisplayName}",p=>p.Files);foreach(var file in folder.Files.AsRequested()){// Use the file}
@timdelavoorde , already created a solution for this. From tomorrow's build you can use the GetFilesFolder methods: this method will use the Graph API to request the driveItemId of the connected folder and then will return you the equivalent IFolder enabling you to use all the file management capabilities of SharePoint.
Docs have been added. Closing this issue now. @timdelavoorde : if you still have issues using the new method with tomorrow's nightly build then please reopen this issue or create a new one.
Category
Describe the feature
Currently it is impossible to load the files or folders that are created under a Teams channel. It is also impossible to create new folders or files
Describe the solution you'd like
I'd like to load the files or folders under a team channel by using channel.LoadAsync(f => f.Files) and channel.LoadAsync(f => f.Folders) respectively.
Additional context
N/A
The text was updated successfully, but these errors were encountered: