自定义连接器,用于在 REST API 中创建项目。我们如何在 Power Apps 中使用此连接器
我们有一个 .NET Web 应用程序,它有 REST API。我们的每个客户都有自己的 API 密钥。现在我们想要创建一个 Power Apps 自定义连接器,它允许我们的用户通过 API 轻松在我们的系统内创建项目。 所以我将创建自定义连接器>>定义 POST 请求,用户必须在其中提交此 JSON 数据:-
{
"id": 0,
"name": "string",
"email": "string",
"phone": "string",
"trusted": true,
"paymentDetails": [
{
"id": 0,
"currency": "string",
"sortCode": "string",
"accountNumber": "string",
"address": {
"id": 0,
"addressLine1": "string",
"addressLine2": "string",
"mainAddress": true,
"type": "BENEFICIARY"
}
}
],
"externalId": "string",
"taxResidency": "string"
}
但我不确定用户将如何在其 Power Apps 中使用此 API?例如,当我们使用内置 SharePoint 连接器时,我们可以在应用程序中执行以下操作:-
添加表单
将表单的源定义为 SharePoint 列表
然后 Power Apps 将自动在表单内添加字段
然后我们只需编写“SubmitForm(FormA)”即可将数据提交回 SharePoint...
所以我有以下三个问题:-
当我们创建自定义连接器并定义上述 JSON 时对象>>我们会获得与 SharePoint 连接器相同的功能吗?所以我们可以在 Power Apps>> 中添加一个表单将其来源定义为我们的连接器>>获取自动添加到表单中的所有字段>>通过调用SubmitForm(****)将数据提交到API?或者事情会更加手动,我们必须自己定义表单字段并手动引用这些字段以提交给 API?
我发现的有关创建自定义连接器的大多数文档和视频都使用 GET 方法。他们通过自定义连接器将参数传递给 API 并获取反馈。但我找不到任何有关如何在自定义连接器内创建 POST 请求,然后使用此 Post 操作构建表单并将表单数据提交到的文档通过自定义连接器访问 API?
由于我们的 JSON 具有嵌套属性,例如 PaymentDetails & PaymentDetails.Address..那么创建自定义连接器时是否支持这些类型的 JSON?如果是这样,那么这些 JSON 属性将如何在 Power Apps 表单字段中表示?换句话说,如果我们想在表单中定义 PaymentDetails.Address.Address1 字段,那么字段名称是什么?
预先感谢您的任何帮助。
问候
We have a .NET web application and it has REST API. Where each of our customers has their own API key. Now we want to create a Power Apps custom connector, which allow our users to easily create items inside our system through the API.
So I will create the custom connector >> define the POST request, where users will have to submit this JSON data:-
{
"id": 0,
"name": "string",
"email": "string",
"phone": "string",
"trusted": true,
"paymentDetails": [
{
"id": 0,
"currency": "string",
"sortCode": "string",
"accountNumber": "string",
"address": {
"id": 0,
"addressLine1": "string",
"addressLine2": "string",
"mainAddress": true,
"type": "BENEFICIARY"
}
}
],
"externalId": "string",
"taxResidency": "string"
}
but what i am not sure about is how users will be consuming this API inside their Power Apps? For example when we use the build-in SharePoint connector, we can do the following inside our Apps:-
Add a form
Define the source for the form to be a SharePoint list
Then Power Apps will automatically add the fields inside the Forms
Then we can simply submit the data back to SharePoint by writing "SubmitForm(FormA)"...
So i have these three questions:-
When we create the custom connector and define the above JSON object >> will we get the same capabilities as in the SharePoint Connector? so we can add a form inside a Power Apps>> define its source to be our connector >> get all our fields automatically added inside the form >> submit the data to the API by calling SubmitForm(****)? or things will be more manual, where we will have to define the form fields by ourselves and manually reference those fields to be submitted to the API?
Most of the documentations and videos i found about creating custom connectors, use GET methods. Where they pass parameters to the API through the custom connector and get the feedback.. but i could not find any documentation about how to create POST requests inside custom connectors, and then use this Post action to build a Form and submit the form data to the API through the custom connector?
Since our JSON have nested properties such as PaymentDetails & PaymentDetails.Address.. so are those types of JSON supported when creating custom connectors? If so then how those JSON properties will be represented inside the Power Apps form fields? in other words, if we want to define the PaymentDetails.Address.Address1 field inside the form then what will be the field name?
Thanks in advance for any help.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题1:是的。对于这两种应用程序来说,后端内置的连接器是相同的。基本上,它会查看从自定义连接器创建的 swagger,并且这些连接器具有相同的响应。
问题 2:当您将操作定义为 POST 时,您会收到响应。该响应可以链接到您的表单,因此它会填充正在返回的数据。再说一次,这是可能的。
问题 3:您将路由命名为 PaymentDetails.Address.Address1,因此引用将为 PaymentDetails.Address.Address1,但字段名称可以重命名为您想要的任何名称。
Question 1: Yes. The connector that's built in the back-end is the same for both applications. Basically it looks at the swagger that's created from your custom connector and those have the same responses.
Question 2: When you define an action as POST, you get a response back. That response can be linked to your form, so it's filled with the data that's being returned. So again, it's possible.
Question 3: You named the route PaymentDetails.Address.Address1, so the reference will be PaymentDetails.Address.Address1, but the name of the field can be renamed to anything you want.