Power Apps: Custom REST API Connector

Last Update: August 28, 2024
Table of Contents
Contributors
Picture of Khairul Alam
Khairul Alam
Tech Stack
0 +
Want to accelerate your software development company?

It has become a prerequisite for companies to develop custom software products to stay competitive.

With custom connectors, we can utilize existing REST API services or create new APIs to expose complex server-side operations that are not available with the out-of-the-box connectors. In this case, we’re dealing with a middle-tier architecture where Power Apps is used as a UI layer. This architecture also offers flexibility. In general, as the complexity of the app increases, you should strongly consider this type of architecture. When multiple data sources are needed to build a single view in that case we can use an API layer to deliver a performant experience, because the data response can be shaped server-side and delivered to the client more efficiently. The use of this middle-tier layer means that you can add a server-side caching layer and implement richer telemetry for the app. Let’s create a Canvas App with custom REST API connector –
1. From Power Apps home expand Dataverse
Capture1-3
2. Select Country/Region and Get started
Capture2 2
3. From top right expand new custom connector, From available options we will select ‘Create from blank’ option. But we can import postman collection, swagger json and so on.
Capture3 3
Capture4 2
give a name and continue…
4. In general section select Schema and provide base URL
Capture5 1
5. From Security section expand authentication options and select authentication type
Capture6 1
6. In defination section provide the required information then click on ‘Import from sample’ then provide the full URL and click on ‘Import’
Capture7 1
Next scrool down and click on ‘Add default response’, provide the example response data then click on import
Capture8 1
7. Skip the Code(Preview) , Keep it as it is. Click on ‘Create connector’ before moving  to ‘Test’ section.
Capture9 3
8. Now select the an operation then clieck on ‘Test operation’
Capture11 1 1
Our connector is ready, Now we will move to next section, Build a Canvas App
9. From Home click on ‘Create’ then  Blank App
Capture1 4 1
10. Now select  Blank Canvas App -> click on ‘Create’ -> Give a name then click on ‘Create’ again
Capture2 3
Capture3 4
11. Click on Data icon then select ‘CustomRestApiConnector’ as data source
Capture5 2
12. Now insert a Button controll inside the container. Then select the button and write following function on OnSelect action:
Capture5.2
13. Now insert a Gallary controll inside the container. Then select datasource
Capture7.1
14. Run the app and click on ‘Load Data’ –
Capture8 2
Yes, our app is running and fetching data from the API.
Our Test API is running on localhost, For testing purpose, accessing localhost from outside and HTTPS has been enbled using ngrok
Capture4.1
Capture4.2 1
Thanks….
Potential Developer
Tech Stack
0 +
Accelerate Your Software Development Potential with Us
With our innovative solutions and dedicated expertise, success is a guaranteed outcome. Let's accelerate together towards your goals and beyond.
Blogs You May Love

Don’t let understaffing hold you back. Maximize your team’s performance and reach your business goals with the best IT Staff Augmentation