cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dekendiz
Frequent Visitor

Opening an html file directly in browser

I've got an app that uses a Flow to create and save an html file to SharePoint. That part works great.

 

But how do I open that html file directly in a browser for easy printing by the user?

 

Depending on what link I use, Launch() either 1) downloads a copy of the html file, which adds unnecessary steps to the user, or 2) opens the html file within the SharePoint container (see attached), which adds unnecessary stuff to the print file.

 

Thanks in advance for any suggestions!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @dekendiz ,

Do you save your HTML file in your SP Library folder?

Do you want to open your HTML file in browser directly rather than download it?

 

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. If you use Launch function to open a HTML file from your canvas app, it would open a dialog to download the HTML file rather than open it in your browser directly.

 

Actually, it is an known issue for Launch function in canvas app. Currently, we could not preview HTML file in web browser using Launch function. The web browser page is actually constructed using HTML code.

 

As an alternative solution, you could consider create and save a PDF file in your SP Library based on the passed HTML text from your canvas app instead of a HTML file. So you need to modify your formula as below:

2.JPG

 

After that, within your canvas app, you could a Icon in your Gallery for launching the PDF file as below:

3.JPG

Set the OnSelect property of the "Document" icon in above Gallery to following:

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

Please check the following GIF screenshot for more details:

Test.gif

 

Please consider take a try with above alternative solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-xida-msft
Community Support
Community Support

Hi @dekendiz ,

Do you save your HTML file in your SP Library folder?

Do you want to open your HTML file in browser directly rather than download it?

 

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. If you use Launch function to open a HTML file from your canvas app, it would open a dialog to download the HTML file rather than open it in your browser directly.

 

Actually, it is an known issue for Launch function in canvas app. Currently, we could not preview HTML file in web browser using Launch function. The web browser page is actually constructed using HTML code.

 

As an alternative solution, you could consider create and save a PDF file in your SP Library based on the passed HTML text from your canvas app instead of a HTML file. So you need to modify your formula as below:

2.JPG

 

After that, within your canvas app, you could a Icon in your Gallery for launching the PDF file as below:

3.JPG

Set the OnSelect property of the "Document" icon in above Gallery to following:

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

Please check the following GIF screenshot for more details:

Test.gif

 

Please consider take a try with above alternative solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, @v-xida-msft. I have tried creating a pdf and it works as you stated, but it takes too long for the Flow to create the pdf for my purposes. In my case, there are techs who have to print many checklists very quickly and hand them off to vendors.

 

With a Flow that creates and saves an html file only, it is almost instantaneous.

Hi @dekendiz ,

Yeah, I understood. Unfortunately, opening a HTML file in web browser using Launch function is not supported in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, I think PDF file would help in your scenario. I have not came up with a better solution for your scenario, if I have, I would let you know here.

 

If the alternative solution I provided above could help in your scenario, please consider go ahead to click "Accept as Solution" to identify my reply as helpful.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I Agree, this is a bit of a bug in the launch function, however, I have discovered a workaround that might help you...

 

If you save the HTML file to SharePoint as an ".aspx" file, then the Launch function opens it up no problem.

 

James.

 

rolandpetit
New Member

Seems this issue has been resolved : on my Power Apps environment 'Launch' automatically opens the html link in the default browser

MarrinerDev
Advocate III
Advocate III

Actually this has nothing to do with the PowerApps Launch() function and is caused by the default security setting for SharePoint which disallows opening html files from document libraries directly in the browser.

i.e. see the following Microsoft article:

https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-permissivesetting#remedia... 

Unless you use a script to change your tenant settings to permissive from strict, the best way to solve this download versus opening issue is to rename your .html files to .aspx.

I tested this approach and it works.

Also note that if you try to open the URL to an html file in a SharePoint library by entering it in the address bar, it will exhibit the same behaviour - proving it has nothing to do with PowerApps.

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (4,102)