cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Custom Connector with Dynamic Base URL

Hello, 
I'm trying to set up a custom connector but the problem I'm running into is that the base URL contains some of the query information needed to return a JSON from an API. For example the query looks like:

 

"www.example.api/base/{query1}/state/{query2}/city/{query3}?api_key"

 

I have not found a way to send these as a variable when using the custom connector. Any ideas or are there new features that have been created recently that I'm not currently aware of? Any help would be much appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Custom Connector with Dynamic Base URL

Ovidiu,

 

I managed to get this sort of connection to work through the use of flow and a button within the powerapp itself.

 

The result looked a little something like this

tempsnip.png

 

I followed a guide at https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/ to get the response to work within the app. Hope this helps anyone else with similar problems

 

Michael

View solution in original post

3 REPLIES 3
Highlighted
Microsoft
Microsoft

Re: Custom Connector with Dynamic Base URL

Hi @mmederos,

 

Did you manage to setup the custom connector?

Did you follow this guide here?

 

Can you show me where you are trying to set that URL?

 

Thank you,

Ovidiu

Highlighted
Frequent Visitor

Re: Custom Connector with Dynamic Base URL

Ovidiu,

 

I managed to get this sort of connection to work through the use of flow and a button within the powerapp itself.

 

The result looked a little something like this

tempsnip.png

 

I followed a guide at https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/ to get the response to work within the app. Hope this helps anyone else with similar problems

 

Michael

View solution in original post

Highlighted
Regular Visitor

Re: Custom Connector with Dynamic Base URL

Try this:

 

  1. Create a new custom connector
  2. Set the Host to api.gsa.gov
  3. Leave the Base URL as / 
  4. Click Security ->
  5. Set Authentication Type to API Key
    1. Parameter Label = apiKey
    2. Parameter Name = apiKey
    3. Parameter Location = Query
  6. Click Definition ->
  7. Add a new action
    1. Fill out the Summary, Description, and Operation ID (this is the method name you'll call from PowerApps)
    2. Under Request, click Import from Sample
      1. Set the Method
      2. Set the URL to https://api.gsa.gov/travel/perdiem/v2/rates/city/{cityName}/state/{stateName}/year/{year}
      3. Click Import

You should see cityName, stateName, and year in the Path section under the URL. Save your connector, then go to the Test tab and select your operation. To the right, you should see three textboxes you can enter the values in. When you call the method from your PowerApp, it's ConnectorName.OperationID("chicago","IL",2020).

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,706)