Forum Discussion
Dom87326
3 years agoHelper II
Problems using Invoke-PowerBIRestMethod to update parameters
Hello community, I’m working with multiple workspaces, reports and using powershell script that takes simple CSV file to determine what .pbix file goes into which workspace and what parameters to...
Anonymous
3 years agoNot applicable
Hi Dom87326,
Are "%Date" and "%Customer" the actual paramater name? And the names were originally preceded by a prefix "%"? Is the date type of "%Date" Text type or Date type? Could you please refer the following thread to change the codes as below and check if it can work....
Update parameters through Powershell
#Group ID and Dataset ID
$urlbase = "groups/4bc15b4f-5dc8-49e3-aaba-XXXXXXXXXXXX/datasets/AAAAAAAA-YYYY-4cb8-898a-222261a5e0d0/"
$body = '{
updateDetails: [
{
"name": "%Date",
"newValue": "11111111"
},
{
"name": "%Customer",
"newValue": "Amazon"
}
]
}'
#url and body for UpdateParameters in API call
$url = $urlbase + "Default.UpdateParameters"
$content = 'application/json'
Invoke-PowerBIRestMethod -Url $url -Method Post -Body $body -ContentType $content
Best Regards