Forum Discussion
Admin1925
Oct 13, 2020Copper Contributor
How to open a file in the Custom spfx teams tab in MS teams
I have created the custom teams Tab using spfx to list all the files in my own desing in the MS teams.In that while clicking the file i need to open a file as same as we open the file in "Files" tab....
Nikitha-MSFT
Oct 16, 2020Former Employee
Admin1925 - To open the sharepoint url with in the teams you need to encode the URL.
Could you please change URL using below code
private string GetFileViewerURL(string actionData_URL, string prefix) { return $"https://teams.microsoft.com/_#/{prefix}/viewer/teams/" + actionData_URL?.Replace("/", "~2F"); }
pheidler
Dec 21, 2023Copper Contributor
Is there a way to do this in New Teams? This no longer works.