无法在 Canvas 应用程序中将表类型作为参数传递

发布于 2025-01-09 16:33:18 字数 1506 浏览 1 评论 0原文

我在自定义连接器中调用了此方法,该方法采用参数“项目名称”(它是一个字符串)和主体“assetIds”中的参数(数组类型[12322,22332])。在连接器中测试它时,我能够成功验证并调用。我尝试使用此公式在应用程序内部调用。

customconnectorname.FilterEvents("myprojectname",{assetIds:[
5884566067180248,
4000106819215821
]})

我收到错误,因为数据源需要字符串并且您正在传递 Table.所以我更改并传递了类似的内容

customconnectorname.FilterEvents("myprojectname",{assetIds:5884566067180248})

,现在我收到错误 data source Expected Table 。我想知道我该如何通过这个?传递值的正确方法是什么。在连接器中,这就是我通过的方式及其工作原理:

在此处输入图像描述

方法声明

在此处输入图像描述

PATH PARAMETERS
project
required
string


QUERY PARAMETERS
assetIds    
string <jsonArray(int64)> (JsonArrayInt64)
Example: assetIds=[363848954441724, 793045462540095, 1261042166839739]
Asset IDs of equipment that this event relates to. Format is list of IDs serialized as JSON array(int64). Takes [ 1 .. 100 ] of unique items.

以下是 PowerApps 中的 swagger 定义。 assetId 部分是:

assetIds:
                type: array
                items: {type: integer, format: int32}
                description: assetIds

在此处输入图像描述

I have this method called in a custom connector which takes a parameter "project name" which is a string and a parameter in body "assetIds" which is of array kind [12322,22332]. and I am able to validate and call successfully when testing it in the connector. I tried to call inside the app using this using this formulae.

customconnectorname.FilterEvents("myprojectname",{assetIds:[
5884566067180248,
4000106819215821
]})

and I get error as datasource expects string and you are passing Table. so I changed and passed something like this

customconnectorname.FilterEvents("myprojectname",{assetIds:5884566067180248})

and now I get error data source Expected Table . I would like to know how should I pass this ? what is the correct way of passing the value. In connector this is how I pass and it works:

enter image description here

Method declaration

enter image description here

PATH PARAMETERS
project
required
string


QUERY PARAMETERS
assetIds    
string <jsonArray(int64)> (JsonArrayInt64)
Example: assetIds=[363848954441724, 793045462540095, 1261042166839739]
Asset IDs of equipment that this event relates to. Format is list of IDs serialized as JSON array(int64). Takes [ 1 .. 100 ] of unique items.

Here is the swagger definition from PowerApps. the assetsId part is :

assetIds:
                type: array
                items: {type: integer, format: int32}
                description: assetIds

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微暖i 2025-01-16 16:33:18

您是否尝试过传递“[id, id, id]”而不是传递“[id, id, id]”?

Have you tried instead of passing [ id, id, id ], do "[id, id, id]"?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文