30
Views
5
Comments
How to embed static Html page in outsystems

Hi All,

I am trying to add the HTML file in outsystems but however I don't get the actual result.

I also followed this post Use Static HTML page | OutSystems but it does not direct to the actual URL. Please assist on the same.



2026-01-28 16-57-48
Mihai Melencu
Champion

Hello @Akshata Tallur ,

I tested the method from your post, and it worked correctly. Could you share what URL you’re being redirected to and why it’s incorrect?

Alternatively, you could try creating a new screen and injecting that HTML there. This discussion might help: How to insert HTML code inside a DIV 

2023-12-07 13-05-35
Akshata Tallur

Hi @Mihai Melencu

I have attached the HTML file please check and assist on the same.

index.html
2026-01-28 16-57-48
Mihai Melencu
Champion

I think there might be an issue with the file itself, the link looks fine and redirects to the correct resource. Could you share the HTML code from the file or the HTML file itself?

Also, I’d recommend removing the link from your post since it’s company-related. 

2026-01-28 16-57-48
Mihai Melencu
Champion

I tested your file in my personal environment and it works correctly. However, it doesn’t work in the company environment, which suggests that the issue is related to the Content Security Policy (CSP) or other security restrictions in place there.

I recommend reaching out to your company’s CoC team. I’ve sent you their contact address privately so you can explain the situation to them directly.

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

Adding and displaying an HTML file in OutSystems can be achieved through multiple approaches, depending on your exact use case. Below are some methods and troubleshooting suggestions for both embedding HTML and using the RedirectToURL method:

1. Embedding HTML Content in an OutSystems Page

If your goal is to embed the content of an external HTML file and display it within an OutSystems page, here are some common methods:

a. Using an iFrame:

  • Add an iFrame to your OutSystems web page.
  • Set the SourceURL property of the iFrame to the location of your HTML file.
  • This approach is useful for loading external or static HTML files but comes with limitations such as cross-domain restrictions.

b. Using the HTML Widget for Dynamic HTML:

  • Drag and drop the Expression widget onto your page.
  • Set its property Escape Content to No to allow rendering of HTML content.
  • Assign the raw HTML code (without <html>, <head>, and <body> tags) to the widget at runtime.

For instance, through screen preparation, you can fetch the HTML content as a text string (e.g., via an API) and bind it to the expression widget. Note: Remove top-level <html> and <body> tags from the content since embedding a nested <html> document isn't valid HTML structure Not able to open complete HTML content as a page.

c. Using OutSystems Forge Components:


2. Redirecting to an HTML File (RedirectToURL Method)

If you want the user to navigate to your HTML file via the link's RedirectToURL method (as shown in ), but it's not working as expected, here are some things you can check:

a. URL Accuracy:

  • Ensure the URL property, currently set to Resources.index_html.URL in your properties panel, correctly resolves to the HTML file.
  • If the HTML file is stored in your module's resources, double-check its deployment and ensure that Resource is set as Public in the file's properties.

b. Resource Configuration:

  • In OutSystems, if you're using a resource file (.html file added to your module), associate its URL with the correct route.
  • Access it using Resources.<FileName>.URL, ensuring the resource has been uploaded and included in the deployment package.

c. Testing the URL Outside OutSystems:

  • Open the generated URL directly in a browser to confirm the file is accessible. If not, the resource might not be correctly deployed.

d. Transition Settings:

  • In the properties of the link under the Transition field, ensure the correct option is selected (<None> or a specific animation for the redirection) Add HTML page in OutSystems.

Key Issues and Alternatives to Consider:

  1. Nested HTML Error:

    • Remember, OutSystems web pages are already HTML documents. Embedding an entire HTML page (with <html> and <body> tags) might result in invalid or broken structures. Consider removing these outer tags.
  2. Cross-Origin Restrictions:

    • If the HTML file is hosted externally, cross-origin policies on the server might block loading it in iframe or when linking with RedirectToURL.
  3. Alternative Approach: Download HTML:

    • Instead of embedding, offer the HTML file as a download to users. Add the HTML file as a resource to your module and provide the file in a Download link using FileDownload logic Converting Data from web screen to HTML file.

Conclusion:

For embedding dynamic HTML, the best method is using the HTML Widget with Escape Content: No. For full HTML redirection, ensure the URL points to an accessible resource or external link, and validate configurational details for resources. Let me know if you face specific challenges!

This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.