【问题标题】:ServiceNow REST API and PowerBIServiceNow REST API 和 PowerBI
【发布时间】:2021-03-29 18:37:31
【问题描述】:

有没有办法直接从 PowerBI 的 service now API 获取数据?我有以下 powershell 代码

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$body = @{
env = "https://companyqa.service-now.com/"
username = "username"
password = "password"
client_id = "client_id"
client_secret = "client_secret"
grant_type = "password"
}

$gettoken = Invoke-RestMethod -Method POST -Uri "$($body.env)oauth_token.do?grant_type=password&client_id=$($body.client_id)&client_secret=$($body.client_secret)&username=$($body.username)&password=$($body.password)" -ContentType 'application/x-www-form-urlencoded'
$token = $gettoken.access_token
echo $token
$headers = @{“authorization” = “Bearer $token”}
$Type = "application/json"
$getincidents = Invoke-RestMethod -Method GET -Uri "$($body.env)/api/now/v2/table/incident?sysparm_query=number=NUM111111" -Headers $headers -ContentType $Type
$getincidents.result 

我正在寻找在 PowerBI 中复制上述内容并直接获取数据的示例。这可能吗?

【问题讨论】:

    标签: powershell api rest powerbi servicenow


    【解决方案1】:

    我建议您使用 PowerBI 内容返回 Service Now 创建一个初始报告,然后您可以在 PowerBI 中找到逻辑并针对您的用例进行自定义。

    来自PowerBI blog on Service Now 连接:

    要连接到内容包,只需提供您的 ServiceNow 实例的 URL,然后使用您的用户名和密码登录。建立连接后,Power BI 将使用您的 ServiceNow 帐户中的数据自动创建仪表板、报表和数据集。

    【讨论】:

      猜你喜欢
      • 2021-07-15
      • 1970-01-01
      • 2022-01-22
      • 2016-03-24
      • 1970-01-01
      • 1970-01-01
      • 2016-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多