Forum Discussion
Token comma Expected Error
Hello all, I'm ftrustrated by token comma expected error with below code when I edit it in PBI query edit window, it shows no error when I tried it in Dataset Execute Queries REST API try page. Is there something wrong?
let
body="{"queries": [
{
"query": "EVALUATE SELECTCOLUMNS ('1#+SM+Missing+Region', '1#+SM+Missing+Region'[SKU])"
}
],
"serializerSettings": {
"includeNulls": true
},
}
",
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/c04c4a4a-274f-4fd2-85cf-ab3138e7227e/datasets/4cd14ac0-b612-48aa-980d-136d46a3e15c/executeQueries",[Headers=[Authorization="Bearer "&Token()],Content=Text.ToBinary(body)]))
in
Source
2 Replies
- ERDCommunity Champion
nbufff , try to play with single quotation marks vs double quotation marks:
let body="{'queries': [ { 'query': 'EVALUATE SELECTCOLUMNS ('1#+SM+Missing+Region', '1#+SM+Missing+Region'[SKU])' } ], 'serializerSettings': { 'includeNulls': true }, } ", Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/c04c4a4a-274f-4fd2-85cf-ab3138e7227e/datasets/4cd14ac0-b61...",[Headers=[Authorization="Bearer "&Token()],Content=Text.ToBinary(body)])) in Source- nbufffHelper I
ERD thanks for advise. Actually, I tried with your advise. But it called another error:
DataSource.Error: Web.Contents failed to get contents from 'https://api.powerbi.com/v1.0/myorg/groups/c04c4a4a-274f-4fd2-85cf-ab3138e7227e/datasets/4cd14ac0-b612-48aa-980d-136d46a3e15c/executeQueries' (415): Unsupported Media Type
Is there anything I failed to add?
let
body="{'queries': [
{
'query': 'EVALUATE SELECTCOLUMNS ('1#+SM+Missing+Region', '1#+SM+Missing+Region'[SKU])'
}
],
'serializerSettings': {
'includeNulls': true
},
}
",
Source = Json.Document(
Web.Contents(
"https://api.powerbi.com/v1.0/myorg/groups/c04c4a4a-274f-4fd2-85cf-ab3138e7227e/datasets/4cd14ac0-b612-48aa-980d-136d46a3e15c/executeQueries",
[
Headers=[Authorization="Bearer "&Token()],
Content=Text.ToBinary(body)
]
)
)
in
Source