Beginner

Intermediate

Expert

Scenario Based

Review the All Piller page

How to Create a Custom Connector in Power Apps

Custom connectors in Power apps

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

  1. Go to make.powerapps.com
  2. Navigate to Solutions
  3. Open your solution
  4. Click New → Automation → Custom Connector
  5. 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.

  1. Click New Action
  2. Summary:
    Get country details
  3. 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

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

  1. Open the Test tab
  2. Click New Connection
  3. Create the connection
  4. Pass a country name (e.g., Japan)
  5. 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

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top