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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Can we perform sql request from custom visual ?

As far as I know, Javascript is a client side pl so we cannot perform sql requests. But for Typescript we can as long as we install the needed package and dependacies.

 

So, can we perform some sql requests like fetch data from an external database using typescript ?

1 REPLY 1
v-viig
Community Champion
Community Champion

Hello @Anonymous,

 

Please pay attention to the fact that Power BI Visuals Tools compile TypeScript code into JavaScript. However, I suppose that it's possbile to perform SQL queries from the client side. You just need to find a proper library (I don't happen to know about such libraries).

 

However, it isn't a good to perform SQL queries from client side because of an ability to inject own third party code that might destroy the database or get some secure data.

I recommend that you shouldn't execute any kind of SQL quesries form the client side in order to keep secutiry and protect database from XSS.

 

I'd would recommend to use some kind of REST API.

 

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.