web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom Connector Funct...
Power Apps
Unanswered

Custom Connector Function failing with the Data Returned in the Response is Invalid

(0) ShareShare
ReportReport
Posted on by 38

I have an Azure Function in my custom connector that returns "single" or "multi". I have built a Custom Connector (code below) and tested and it works fine (response below). As expected the body of the response has a single word. When I call the function from PowerApps i get "Data Returned in the Response in Invalid".

 

 

 

/SingleOrMulti:
 get:
 responses:
 '200':
 description: Success
 schema: {title: Similarity, type: string}
 summary: SingleOrMulti
 description: SingleOrMulti
 operationId: get-SingleOrMulti
 parameters:
 - {name: string1, in: query, type: string}

 

 

 

 
 

Response.PNG

 

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @John_Martel ,

    Could you please share a bit more about the formula you executed within your canvas app?

    Do you mean your Azure function could return a single value (Text String value)?

     

    Based on the OpenAPI JSON definition that you mentioned, I could not find any syntax error with it. Please make sure your whole OpenAPI definition file looks like below:

    {
     "swagger": "2.0",
     "info": {
     "version": "1.0.0",
     "title": "MyAzureFunction"
     },
     "host": "azurefn.azurewebsites.net",
     "paths": {
     "/api/HttpTriggerCSharp1": {
     "get": {
     "description": "Calls my azure function over https",
     "operationId": "RunThis",
     "parameters": [
     {
     "name": "code",
     "in": "query",
     "description": "code",
     "default": "h6ztu…[your code here]…i",
     "type": "string"
     },
     {
     "name": "name",
     "in": "query",
     "required": true,
     "type": "string"
     }
     ],
     "responses": {
     "200": {
     "description": "Successful response",
     "schema": {
     "title": "The response of the api.",
     "type": "string"
     }
     }
     }
     }
     }
     }
    }

    More details about the creating a custom connector based on Azure function, please refer to the following blog:

    https://powerapps.microsoft.com/de-de/blog/using-azure-functions-in-powerapps/

     

    Please check if the result your Azure function returned is always a Text string value. As an alternative solution, you could consider re-define your Azure function, to make it return a Object value. Then based on the modified Azure function, re-generate a new custom connector, check if the issue is solved.

     

    Within your canvas app, please execute your custom connector action within Behavior property of a control, e.g. OnSelect property of a button, rather than Non-Behavior property of a control.  Set the OnSelect property of a button to following:

    Set(ReturnedValue, 'Custom Connector'.get-SingleOrMulti("xxxx"))

    then check if the ReturnedValue variable is populated with proper value

     

    Best regards,

  • John_Martel Profile Picture
    38 on at

    Thanks I was bale to get working by converting the response to a JSon string, and then changing the Swagger format to Object.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard