How to pass parameters to Custom Connector Actions from PowerApps App

Requirement

I have a CustomConnector that connects to Microsoft Graph REST API to get the groups in an organization. This endpoint URL and query parameters such as orderby, filter, skiptoken, top are currently hardcoded but I would like to make it generic so that I can reuse by passing arguments to the connector from the PowerApps.

Solution

To create a custom connector, you must describe the API you want to connect to so that the connector understands the API’s operations and data structures. The custom connector wizard gives you a lot of options for defining how your connector functions, and how it is exposed in apps.

On the Definition page, The Request area displays information based on the HTTP request for the action. Choose Import from sample and configure sample as shown below:

At the top right of the wizard, choose Update connector. Now that we have configured the connector, test it to make sure it’s working properly.

On the Test page, create connection and return to the Test page:

Now, enter the values for the text fields, then choose Test operation.

The connector calls the API, and you can review the response.

Return to your PowerApps app and configure your expression as show below:

That is all. The Group Collection should have the REST API response data.

Important Note: Some requests return multiple pages of data so do not pass the $skiptoken for the first call. The $skiptoken parameter contains an opaque token that references the next page of results and is returned in the URL provided in the @odata.nextLink property in the response.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.