Logo
banner

Blogs

Connect to an API from the PowerApps using the custom connector

, May 23, 2019 27585 Views

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

mm

Inkey

INKEY is your solution partner.
Our focus is to deliver you in-time intelligent innovative solutions ("key") for the problems in hand. Maintaining a quality standard right from the inception of a project is our top most priority.

Our team of talented professionals will execute your projects with dedication and excellence. We take ownership and accountability for the effort that goes into meeting our client’s needs.

Years of experience and proven success of delivering innovative custom solutions.

More posts by

6 responses to “Connect to an API from the PowerApps using the custom connector”

  1. Soha Zain says:

    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

  2. Piero says:

    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.

  3. Miguel Angel says:

    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.

Leave a Reply

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

The maximum upload file size: 2 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Drop file here

Would you like to digitize your business and put it on the cloud?
Do you need clear, concise reports for your organization?