Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
I have the below $Body variable to use within my API Invoke command, how can I exit the single quotes to reference my $server and $database variables? I currently receive the error: "DMTS_UnsupportedConnectionStringError". I've tried to add single quotes to exit but this triggers an unexpected token:
Solved! Go to Solution.
The issue was my server variable required "\\" not "\". Code that worked for me:
The issue was my server variable required "\\" not "\". Code that worked for me:
$Body = @"
{
"datasourceType":"SQL",
"connectionDetails":'{"server":$server,"database":$database}',
"datasourceName":$gatewaySourceName
}
"@@
note that the last line should be "@ . Can't get rid of the second @
Thanks! I actually have further details in my $Body so would the below be the correct syntax? I'm getting a "BadRequest" on my Invoke:
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |