动态地指power查询中的JSON节点
我的功能可以从JSON文档中提取节点,如下所示:
...
Json = GetJson(Url),
Value = Json[#"values"]
值对应于JSON文档中的实际节点。
我想概括此代码,并提供节点的名称为一个变量:
let myFunc = (parentNodeName as text) =>
...
Json = GetJson(Url),
Value = Json[parentNodeName]
但是获取此错误: “ MyFunc”查询中发生了错误。 Expression.Error:未找到记录的字段'parentNodeName。
如何动态地参考JSON节点?
I have a function that extracts a node from JSON document as follows:
...
Json = GetJson(Url),
Value = Json[#"values"]
values correspond to the actual node within the JSON document.
I would like to generalize this piece of code and provide the name of the node as a variable like:
let myFunc = (parentNodeName as text) =>
...
Json = GetJson(Url),
Value = Json[parentNodeName]
However getting this error:An error occurred in the ‘myFunc’ query. Expression.Error: The field 'parentNodeName' of the record wasn't found.
How can I refer to the JSON node dynamically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
示例代码:
和myfunc:
Try
sample code:
and myFunc: