【发布时间】:2020-10-23 21:47:19
【问题描述】:
我在使用 Power Query 连接到带有 Power B.I 的 API 时遇到问题,我不太了解语法。
一开始我尝试了这个方法,但是失败了,因为这个API的方法是POST。
let
Source = Json.Document(Web.Contents("https://URL", [Headers=[Authorization="Bearer XXX"]])),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"),
#"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"id", "name", "isoCode", "treeId"}, {"Value.id", "Value.name", "Value.isoCode", "Value.treeId"})
in
#"Expanded Value1"
我也试过
let
body = [{id="2", iso="be", name="be"}],
AccessTokenList = List.Buffer(api_token),
access_token = AccessTokenList{0},
AuthKey = "Bearer XXX" & access_token,
url = "URL",
Response = Web.Contents(url, [Headers=[Authorization=AuthKey, ContentType="application/json", Accept="application/json"], Content=Text.ToBinary(body)]),
JsonResponse = Json.Document(Response)
in
Response
但我仍然没有任何好的结果。有人可以指导我使用 Power Query 吗?
谢谢!
【问题讨论】:
标签: api post powerbi powerquery m