Do you want to know more details about how to create a Power Apps Custom Connector / Power Automate?
We will detail the different options and scenarios of how to create a Power Apps Custom Connector / (or on Power Automate).
Microsoft Power Apps / Microsoft Power Automate allows you to connect to almost every web service out there. There are a wide variety of connectors available for you to use.
If you need a connector that doesn’t exist yet, you can create your own Custom Connector. You can even create custom connectors for any web service with an API.
What is a PowerApps Custom Connector?
A custom connector is a tool that allows you to connect your custom APIs to the Microsoft Power Apps or Microsoft Power Automate and Azure Logic Apps.
A Custom Connector is a wrapper around an API that allows communication.
How to configure a Power Apps Custom Connector to call an API?
For adding an API in Power Apps or Power Automate, there are different options available, which can be resume in 2 scenarios:
- Scenario 1: Create a new custom connector from scratch (New).
- Scenario 2: Create a new custom connector from an existing definition file (Import).
API Information for the PowerApps Custom Connector example
For this example, we will be using a free API called Reqres.
Reqres – is a hosted REST-API ready to respond to your AJAX
API Get List of users method: https://reqres.in/api/users
Scenario #1- Start Creating the Power Apps Custom Connector from Scratch
1- Sign in to Power Apps or Power Automate.
2- Select Dataverse -> Custom connectors (Navigation pane on the left).
3- Select New custom Connector -> choose to Create from blank.
4-Enter a name for the custom connector, then select “Continue“.
Important: Notice that nowadays after creating the Connector, you cannot change the Connector name.
Step 1: General details of the API and Power Apps Connector
On the General tab:
- In the Description field, enter a meaningful value. This description will appear in the custom connector’s details, and it can help others know if the connector could be useful to them. Example with: test api
- Schema: HTTP or HTTPS. Example with: HTTPS
- Update Host to the address for the API Url. The connector uses the API host and the base URL to determine how to call the API. Example with: reqres.in
Note: Not enter the full API URL, as you select first the Schema (HTTP/HTTPS)
Select on Security to continue.
Step 2: Power Apps Custom Connector Security: Choose authentication type
On the Security tab:
2.1- Choose the authentication type. Example with: No Authentication.
Select on Definition to continue.
Step 3: Power Apps Custom Connector definition
On the Definition tab:
3.1- Create a New Action – Actions > Select New Action
3.2- Complete the Summary / Description / Operation ID for the new action.
3.3- Request – Import from sample – Get List
Select Import from sample.
3.4- Response – Add default response – JSON Get List Response
Select Add default response
3.5- Select Import from sample
3.6- Copy a RAW JSON response from URL
In example case from the URL: https://reqres.in/api/users
Or Copy an RAW JSON response from Postman:
3.7- Paste Body example (as shown below):
Then, select Import
Finally you will see the properties loaded in the response.
3.8- Select on Code to continue.
Step 4: (Optional) Using custom code on a Power Apps Custom Connector
- This step is optional. You can complete creating your connector by passing this step and going to Step 5: Test the Power Apps custom connector.
Using C# code, you can transform request and response payload data beyond the scope of existing policies. Transformations include sending an external request to fetch additional data.
On the Code tab:
4.1- Select on Test to continue.
Step 5: Test the Power Apps Custom Connector
On the Test tab:
- For testing:
First, you have to create the connector and create a connection. Don’t worry, have the steps before.
5.1- Create Connector
Select Create Connector.
5.2- Create a new connection
Select New Connection.
Then, select Create.
5.3- Test Operation
Select Test Operation.
Congratulations! Now you are done, you can use the Custom Connector in Power Apps or Power Automate (ex Flows).
How to export/download an existing custom connector on PowerApps?
It is a Best Practice to download all your connectors and use GIT or any other source code management system to save the files.
Easy, Select download on the custom connector:
Scenario #2: How to import an existing custom connector on PowerApps?
1- Select Dataverse > Custom connectors (Navigation pane on the left).
2- Select New custom connector, then choose Import an OpenAPI file.
Note: Another good option is to import a Postman collection (previously, you need export the Collection from Postman).
Insert the new name of the custom connector.
Then, select import for searching the file (select your file).
Finally, select Create.
Download working example: API-Test-Connector.swagger.v1.json
Finally, Select Create Connector
Integrating PowerApps with APIs (Custom Connector):
1- Sign in to Power Apps.
2- Create a new app or use an existing one.
Home > Blank app
3- Add the existing Custom Connector:
On the left pane, Data, Select Add Data,
Select Connectors tab or Find your custom connector name on the list.
Select the custom connector (it will load and create a connection).
4- Verify the Custom Connector:
In the list of connectors, select the custom connector.
On the Data pane, verify that the custom Connector (in this example APITestConnector) is listed.
5- We will add a new Gallery to use the Custom Connector and API.
-Insert a Gallery (example vertical).
6- On the Gallery properties, set Items:
7- Change image property to “API.Response.data.avatar”
8- Change the Text property to:
ThisItem.first_name & ” ” ThisItem.last_name
9- Final Result
Congratulations! Now you are done!. You created a custom connector in Power Apps from Scratch and integrated it into a Canvas Power App.
Power Apps Premium Connector pricing and cost
Important: A premium license is required for using custom connectors.
Power Apps pricing