In many scenarios, we need to call the APIs or services that are not available as the inbuilt connectors of the PowerApps. In that case, you can create your own custom connector with the required triggers and actions.
Creating a custom connector is a very smooth process. What you need is only the correct API key and the URL of the service you want to connect to.
In this blog, we will learn how to create a custom connector from the Postman collection. For that, you need to first create a postman collection for the custom connector.
Please read the below link:
https://docs.microsoft.com/en-us/connectors/custom-connectors/create-postman-collection
Once you have created the Postman collection, you need to import that collection to the PowerApp.
For that, navigate to the “Custom connectors” tab from your PowerApp and click on the “Create custom connector” button. Then, select “Import a Postman collection” option as shown in the below image:-
On click of the “Import a Postman collection” option, a popup will be opened in which you should enter the name for the Custom connector to be created and then select the Postman collection(JSON file) by clicking the “Import” button. Then, click on continue.
Now, a wizard will be opened as follows:-
In the Definition tab, all the details will be pre-populated based on the postman collection and the details filled up in the General & Security tab.
Now, navigate to the Test tab to test the postman collection. But prior to that, you need to save the connector. Once saved, it will allow you to test the connector by executing the postman collection.
Create a new connection to test the custom connector by inserting the API key for your postman collection.
You can also provide the input parameter values in the body section as required:
You can then call this connector in your PowerApps to connect the API as follows:
First, add the above-created custom connector to the PowerApps as a data source.
Then call the custom connector using the below formula:
Syntax:
your_custom_connector_name.Run(parameter 1, parameter 2,…..)
You can also save the output from the connector to a collection or a variable and proceed further as required.
For example:
UpdateContext({Result: your_custom_connector_name.Run(parameter 1, parameter 2,…..)});
Then use this Result as a value in a control say label as Result.value1.
I hope this helps you!!
Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox
Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr
Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator
© All Rights Reserved. Inkey IT Solutions Pvt. Ltd. 2024
Amazingly Great job. Thanks for sharing this topic “Connect to an API from the PowerApps using the custom connector”. The best part is the article has all the practical detailing! Keep sharing
Hi, I’m trying to do the same. it is working, however when I share my app with other users they are asked to provide sign in to the connector and provide the API key, obviously I don’t want to share the API key with them because of security issues. I have share the connection with them but still having the same issue.
Hi Piero,
I am really sorry for the late reply.
Please check if you have shared the custom connector with the required user. If not then you can follow the below link for sharing.
Link – https://docs.microsoft.com/en-us/connectors/custom-connectors/share#sharing-in-power-apps-and-power-automate
I hope it will help you!!
Hi Piero,
I am really sorry for the late reply.
Please check if you have shared the custom connector with the required user. If not then you can follow the below link for sharing.
Link – https://docs.microsoft.com/en-us/connectors/custom-connectors/share#sharing-in-power-apps-and-power-automate
I hope it will help you!!
How would it be possible to create the connection to a REST API that requires two parameters (username and password) and returns the Bearer Token? My idea would be to share a PowerApp that asks customers to fill in their username and password, and returns the value of the Bearer Token.
Hello Miguel,
Happy new year. I believe you should be able to achieve your requirement. Please refer to this link for details.
https://docs.microsoft.com/en-us/connectors/custom-connectors/connection-parameters#basic-authentication