cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
a-ovbord
Community Support
Community Support

Hi @Anonymous,

 

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

Anonymous
Not applicable

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

micah-bittitan
Regular Visitor

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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,719)