cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Create a 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 referencing 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 property inside the form then what will be the field name?

 

Thanks in advance for any help.

 

Regards

   

1 ACCEPTED SOLUTION

Accepted Solutions
Syndicate_Admin
Administrator
Administrator

1. Things will be bit more manual when you a custom connector. You will have to create a form in the app and bind its fields to variables and then while invoking an action in the custom connector, you can read from those variables.

2. Here is a tutorial of using custom connector in Power Apps - Custom Connectors Tutorial in Power Apps - YouTube 

3. Nested properties are supported in custom connector. You should be able to construct your JSON payload to be sent to connector using the JSON function - JSON function in Power Apps - Power Apps | Microsoft Docs

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

1. Things will be bit more manual when you a custom connector. You will have to create a form in the app and bind its fields to variables and then while invoking an action in the custom connector, you can read from those variables.

2. Here is a tutorial of using custom connector in Power Apps - Custom Connectors Tutorial in Power Apps - YouTube 

3. Nested properties are supported in custom connector. You should be able to construct your JSON payload to be sent to connector using the JSON function - JSON function in Power Apps - Power Apps | Microsoft Docs

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Top Solution Authors
Top Kudoed Authors
Users online (3,680)