简体   繁体   中英

Custom connector to create an item inside our REST API. How we can use this connector inside Power Apps

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:-

  1. Add a form

  2. Define the source for the form to be a SharePoint list

  3. Then Power Apps will automatically add the fields inside the Forms

  4. Then we can simply submit the data back to SharePoint by writing "SubmitForm(FormA)"...

So i have these three questions:-

  1. 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?

  2. 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?

  3. 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM