Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
User | Count |
---|---|
5 | |
4 | |
4 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
4 | |
4 | |
4 |