简体   繁体   English

Power BI REST API 查询参数

[英]Power BI REST API query parameters

I am using the new query parameters API https://msdn.microsoft.com/en-us/library/mt845781.aspx我正在使用新的查询参数 API https://msdn.microsoft.com/en-us/library/mt845781.aspx

I am able to call parameters fine, however when trying to set them I get an error message.我可以很好地调用参数,但是在尝试设置它们时,我收到一条错误消息。 After parsing the error I get this解析错误后,我得到了这个

VERBOSE: POST https://api.powerbi.com/v1.0/myorg/groups/e7229a42-46ef-4d80-b8ca-e42909509dbb/datasets/5ef116d7-917 ... with -1-byte payload详细:发布https://api.powerbi.com/v1.0/myorg/groups/e7229a42-46ef-4d80-b8ca-e42909509dbb/datasets/5ef116d7-917 ... 带有 -1 字节的有效负载

error : @{code=InvalidRequest;错误:@{code=InvalidRequest; message=Dataset Parameters list is invalid in 5ef116d7-9179-40a2-8a30-a657265dfe4a. message=Dataset 参数列表在 5ef116d7-9179-40a2-8a30-a657265dfe4a 中无效。 Reason: Empty;原因:空; target=5ef116d7-9179-40a2-8a30-a657265dfe4a}目标=5ef116d7-9179-40a2-8a30-a657265dfe4a}

I don't understand because the parameters list is not empty?我不明白,因为参数列表不为空? I have created a physical table with the parameters and tried and then also created a list of values in the manage parameters settings and it still gives the same error.我已经创建了一个包含参数的物理表并尝试过,然后还在管理参数设置中创建了一个值列表,但它仍然给出相同的错误。

PowerShell - PowerShell -

$parametername = "YourData" 
$parametervalue = "Company1" 

#POST body 
$postParams = @{
"name" = "$parametername"
"newValue" = "$parametervalue"
   } 

JSON from documentation (I am not including updatedetails in PowerShell because I don't know how)来自文档的 JSON(我没有在 PowerShell 中包含updatedetails ,因为我不知道如何)

 "updateDetails": [ 
    { 
      "name": "MaxId", 
      "newValue": "5678" 
    }, 
    { 
      "name": "StrParam", 
      "newValue": "Another Hello" 
    } 
  ] 
} 

You can find the solution here你可以在这里找到解决方案

You just need to enable the Load for the parameters您只需要为参数启用负载

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Power BI Rest API从Power BI应用程序检索所有用户的列表? - How to retrieve a list of all users from a Power BI app using the Power BI Rest API? 通过 REST API 获取 Power BI 度量值和列 - Getting Power BI Measures and Columns via REST API 通过 REST API 在 Power BI 报表服务器上设置报表数据源和凭据以建立计划刷新 - Set report data source and credentials on Power BI Report Server through REST API to establish a scheduled refresh 异步刷新 Power BI REST API:响应不包括应包含 refreshId 的位置字段 - Async refresh Power BI REST API: Response doesn't include location field that should contain refreshId 尝试使用Power BI REST API时出错-Invoke-RestMethod:找不到接受参数的位置参数 - Error when trying to use Power BI REST API - Invoke-RestMethod : A positional parameter cannot be found that accepts argument Power BI:尝试更新参数 vi PowerShell API 调用 - Power BI: Attempting to update parameter vi PowerShell API call 使用PowerShell刷新Power BI - Refresh Power BI with PowerShell Power Bi 订阅 - Power Bi subscriptions 从 PowerShell 从 Power BI REST API 获取组内刷新历史记录并导出 CSV - From PowerShell Get Refresh History In Group from Power BI REST APIs and export do CSV 示例Power-Shell脚本以从REST API读取值 - sample power-shell script to read values from REST API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM