我创建了一个 定制连接器 我们的REST API,返回 表格数据. 我在一个canvas powerapp中使用它作为一个数据源,它将自定义连接器中的记录存储到了一个名为 "Display "的应用程序中。集合. 这个集合被一个图库用作数据源,它成功地显示了项目和每个项目的属性。然而,当我尝试 创建一个编辑表格 使用 集合 作为数据源,它不能访问字段。它不能直接使用 定制连接器 作为数据源也。
在 本回答 从@aorphan那里我读到,你可以在表单中使用自定义连接器。只要他们回来 桌子 而不是动作. 而据我所知,该集合的内容是表格数据。
然而,即使将集合设置为一个新的编辑表单的数据源,它也无法从数据源中添加任何字段。
万一我的数据需要更丰富的定义才能被表单正确解释,我的API返回的JSON是这样的。
{
"quotes": [
{
"quote_pk": 347,
"shipment_name": "test add leg",
"organization_ff_name": "LIFE",
"quote_id": "1234",
"effective_until": "2020-05-10",
"eta": "2020-05-14T12:00:00Z",
"price": 100.0,
"quote_status": 2
},
{
"quote_pk": 345,
"shipment_name": "test modal review",
"organization_ff_name": "LIFE",
"quote_id": "123",
"effective_until": "2020-05-11",
"eta": "2020-05-22T12:00:00Z",
"price": 1749.94,
"quote_status": 6
}
]
}
而我的自定义连接器的定义是这样的:
swagger: '2.0'
info: {title: some title, description: some description, version: '1.0'}
host: server.domain.com
basePath: /organizations/endpoint/
schemes: [https]
consumes: []
produces: []
paths:
/organizations/endpoint/shipment_quotes/: {}
/shipment_quotes/:
get:
responses:
'200':
description: default
schema:
type: object
properties:
quotes:
type: array
items:
type: object
properties:
quote_pk: {type: integer, format: int32, description: quote_pk}
shipment_name: {type: string, description: shipment_name}
organization_ff_name: {type: string, description: organization_ff_name}
quote_id: {type: string, description: quote_id}
effective_until: {type: string, description: effective_until}
eta: {type: string, description: eta}
price: {type: number, format: float, description: price}
quote_status: {type: integer, format: int32, description: quote_status}
description: quotes
summary: peration summary
description: operation description
operationId: operationId
parameters:
- {name: Content-Type, in: header, required: false, type: string}
- {name: Accept, in: header, required: false, type: string}
definitions: {}
parameters: {}
responses: {}
securityDefinitions: {}
security: []
tags: []
请帮助我获得正确的数据源 以便表单能够添加它的字段 或者至少让我知道万一因为某些原因无法添加字段 我就可以继续了
正式在PowerApps中,集合不能作为表单控件的数据源。你的努力令人钦佩,而且看起来你已经尝试了所有的方法,所以我把我的小秘密告诉你。它可能不受官方支持,所以使用时风险自负。
Items
属性到Collection(你已经做了)。DataSource
属性到Collection(你已经做了)。Add Custom Card
Default
属性为 gallery.Selected.X
其中 "X "是您要在表格中编辑的值。在表单中创建一个 "提交 "按钮,它是PatchesUpdateIf的集合。然后 从Custom Connector中调用POST(或PUT)方法,将编辑的内容修补回DataSource。
8a. 我在你的swagger文件中只看到一个GET请求。你将(很明显)需要一个POSTPUT来获取数据。从 收藏品 到 您的DataSource。
8b. 这个小 "包装器 "很可能是PowerApps为你处理的,当你使用一个 "批准的 "DataSource为一个表单控件。
注意:你的Form将在PowerApps中显示 "无数据源"。 你的Form会在PowerApps studio中显示 "No data source",但你的用户不会看到它。
有什么帮助吗?