
If you want to connect Power Apps to an external REST API, you need to create a Custom Connector in Power Apps.
In this guide, Iâll show you how to create a custom connector in Power Apps using a free public REST API (Rest Countries API). Weâll build it step by step and use it inside a Canvas App to fetch a countryâs capital and population.
What Is a Custom Connector in Power Apps?
A Custom Connector in Power Apps allows you to connect any external REST API to your app when a standard connector is not available.
In simple words, it acts as a bridge between Power Apps and external services.
You can use custom connectors to connect:
- Public APIs
- Internal company APIs
- AI services
- Third-party platforms
Now letâs build one.
Watch this video for full tutorial.
Step 1: Understand the API Weâll Use
Weâll use the Rest Countries API:
https://restcountries.com/v3.1/name/{country}
If you pass a country name like:
https://restcountries.com/v3.1/name/japan
It returns JSON data including:
- Capital
- Population
- Region
- Currency
For this example, weâll use only:
- Capital
- Population
Step 2: Create a Custom Connector in Power Apps
- Go to make.powerapps.com
- Navigate to Solutions
- Open your solution
- Click New â Automation â Custom Connector
- Name it: Get Country Details
Youâll see five sections:
- General
- Security
- Definition
- Code
- Test
Weâll configure each one.
Step 3: Configure the General Section
- Upload an icon (optional)
- Keep default background color
- Select HTTPS
- Host:
restcountries.com
Click Next.
Step 4: Configure Security
Since this is a public API:
- Select No Authentication
Click Next.
Step 5: Define the Action
Now we define how Power Apps will call the API.
- Click New Action
- Summary:
Get country details - Operation ID:
GetCountryDetails
Import the Request
- Click Import from Sample
- Select GET
- Paste:
https://restcountries.com/v3.1/name/japan
- Click Import
Validation should be successful.
Step 6: Configure the Response
- Click Add Default Response
2. Copy the API JSON response
3. Keep only:
capital
-
- population
4. Paste the trimmed JSON into the Body
5. Click Import
Go to Code (no changes required).
Click Create Connector.
Your custom connector in Power Apps is now created.
Step 7: Test the Custom Connector
- Open the Test tab
- Click New Connection
- Create the connection
- Pass a country name (e.g., Japan)
- Click Test Operation
You should see:
- Capital â Tokyo
- Population â Japanâs population
Now we can use it inside a Power App.
Step 8: Use the Custom Connector in a Canvas App
- Create a Blank Canvas App
- Go to Data
- Add your custom connector
Now build a simple interface:
- Text Input (Country Name)
- Two Labels (Capital & Population)
- One Button (Get Country Details)
Step 9: Call the Custom Connector Using Power Fx
On the buttonâs OnSelect, write:
Set( CountryDetails, GetCountryDetails.Run(TextInput1.Text) ); Set( CapitalValue, First(CountryDetails).capital ); Set( PopulationValue, First(CountryDetails).population );
Because the API returns a table, we use First() to access the first record.
Now bind:
- Capital Label â CapitalValue
- Population Label â PopulationValue
Step 10: Test the App
Run the app and try:
- Japan
- Brazil
- Pakistan
- China
Each time, youâll see the correct capital and population.
That means your custom connector in Power Apps is working perfectly.
Why Custom Connectors Are Powerful
When you know how to create a custom connector in Power Apps, youâre no longer limited to built-in connectors.
You can integrate:
- Weather APIs
- Finance systems
- AI services
- Enterprise backend systems
This gives you full flexibility to extend Power Apps beyond standard capabilities.
Refer this Microsoft Documentation for more details.
Click for more Power apps Interview question


