cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

JSON SCHEMA: Which is correct?

I'm working through some Custom Connector challenges and came across something interesting. Instead of continuing to try the Custom Connector, my friend suggested trying the API call in Flow then calling the Flow from PowerApps.

Here is what the Flow looks like:

customConnectorFlow.png

It worked without issue which is just incredible seeing how much time I spent on it vs. the Custom Connector today!
customConnectorFlow7.png

With the problematic Custom Connector I mentioned earlier, the Schema I "Imported from Example" was from a successful call using the (excellent) Azure Map API Docs:

customConnectorFlow1.png

Imports just fine... (notice the Body parameters)

customConnectorFlow2.png

API Tests and Responds just fine...

 

customConnectorFlow3.png

...BUT when used in a PowerApp with the function:

ClearCollect(colAzureTimezone,
    azureMapTimezone.AzureMaps("1.0","json",{query: Label1.Text})
)
// Also tried Location.Latitude & "," & Location.Longitude in lieu of "Label1.Text" above. Label1 holds the same function.

, the Custom Connector returns a blank Collection in the App...
customConnectorFlow4.png

Since the Flow works just fine, I decided to paste its schema into the Custom Connector. LOOK AT HOW DIFFERENT THE BODY PARAMETERS ARE!

customConnectorFlow5.png

Yet the Test is successful as well...

customConnectorFlow6.png

Yes the darn Connector returns a (different) blank Collection...

customConnectorFlow8.png

 

  • I've defined the schema two ways
    • One of them works great with Flow when called by the PowerApp
    • Both of them Test successful in the Custom Connector "Test" area
    • Neither of them work with the Custom Connector when called by the PowerApp. 

Am I losing it or do you all see this as crazy too!?!

2 REPLIES 2
Super User
Super User

Re: JSON SCHEMA: Which is correct?

Hi @ericonline

I suspect your problem might be caused by a combination of authentication and an incorrect definition of the API response.
I created a custom connector and with my implementation, I was able to return data into my collection with the following formula.

ClearCollect(colAzureTimezone,
             AzureMap.GetTime("EnterYourAPIKeyHere...rbhBxfleNR6BSlBp", "1.509865, -0.118092", "1.0")
)


colAzure.JPG
I've uploaded my OpenAPI definition here - perhaps you could use this to create a new custom connector? If it works, we could maybe work back from this to answer your question more specifically.

 

 

seadude
Level 10

Re: JSON SCHEMA: Which is correct?

Hi @timl. Thank you for looking into my madness here.

The API Key is in the URL, just not visible in the PowerApp function. This is done by setting the visibility to "Internal" in the Custom Connector itself. I'm using this exact call in my personal Azure/PowerApps instances. The issues reported have all been in my enterprise Azure/PowerApps world.

Here is the call (personal):

2018-12-14-07-09-36.png

Here is the successful Collection (personal):

2018-12-14-07-09-59.png

Here is the subscription-key parameter set to "Internal" so that it doesn't need to be specified in the PowerApp Function. (NOTE: API Key was cut from the Default field before taking this screenshot)

2018-12-14-07-11-31.png

I literally exported this functioning Custom Connector from personal world, imported it into enterprise world, changed the API key, tests great in the Custom Connector "Test" area, brings back blank Collection in the actual app...

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 192 members 6,578 guests
Please welcome our newest community members: