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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 4 | |
| 3 | |
| 3 |