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:
It worked without issue which is just incredible seeing how much time I spent on it vs. the Custom Connector today!
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:
Imports just fine... (notice the Body parameters)
API Tests and Responds just fine...
...BUT when used in a PowerApp with the function:
// 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...
Since the Flow works just fine, I decided to paste its schema into the Custom Connector. LOOK AT HOW DIFFERENT THE BODY PARAMETERS ARE!
Yet the Test is successful as well...
Yes the darn Connector returns a (different) blank Collection...
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!?!
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.
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):
Here is the successful Collection (personal):
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)
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...