Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
admhemed
Frequent Visitor

load an html template into custom visual

how to import html-content.html into my code?

 

in my constructor I write 

$.get('/src/html-content.html', function(data) {
console.log(data);

});

which results into an xhr to https://app.powerbi.com/src/html-content.html

 

thanks

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@admhemed,

 

You may wrap it up in a JavaScript file.

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

thanks,

I thought of this. This helps in dividing the code, but if html is wrapped in javascript, webstorm considers it as a string, even when in back-ticks (` `).

v-viig
Community Champion
Community Champion

As an alternative, you might try to use webpack or gulp to preprocess the code but this is out of scope of PBIVIZ tools.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.