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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.