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

Custom API fails to load data on form

Hi All, 

 

Try to test a connecting to an azure function. Everything is good until i try to use the connection on the form. Receive an error that "The Data returned in the response is invalid". I am using the default azure functions test function to try and pull in name to a field. The test of the function in power apps succeeds but not on the form. Any help with why it failes out on the form but not on the test conections or suggestions on troubleshooting would be appreciated. Swagger file below - 

 

{
    "paths": {
      "/api/Function1": {
        "get": {
          "operationId": "RunThis",
          "summary": "Default API function",
          "description": "Calls my default Azure Function over Https",
          "responses": {
            "200": {
              "description": "Successful response",
              "schema": {
                "x-oad-type": "string",
                "type": "string",
                "title": "The response of the api."
              },                             
              "x-oad-type": "response"
            }
          },
          "parameters": [
            {
              "name": "code",
              "in": "query",
              "description": "code",
              "required": false,
              "type": "string",
              "default": "<code>",
              "x-oad-type": "parameter"
            },
            {
              "name": "name",
              "in": "query",
              "description": "Name Value ",
              "required": true,
              "type": "string",
              "x-oad-type": "parameter"
            }
          ]
        },
        "x-oad-type": "operation"
      },
      "/api/CreateBarcode": {
        "get": {
          "operationId": "CreateBarcode",
          "summary": "Generates Barcode image",
          "description": "Generate a barcode file ",
          "responses": {
            "200": {
              "description": "Successful response",
              "schema": {
                "x-oad-type": "string",
                "type": "string",
                "title": "The Response of the API"
              },                             
              "x-oad-type": "response"
            }
          },
          "parameters": [
            {
              "name": "code",
              "in": "query",
              "description": "code",
              "required": false,
              "type": "string",
              "default": "<code>",
              "x-oad-type": "parameter"
            },
            {
              "name": "Number",
              "in": "query",
              "description": "Number to create barcode from",
              "required": false,
              "type": "integer",
              "format": "int32",
              "x-oad-type": "parameter"
            }
          ]
        },
        "x-oad-type": "operation"
      }
    },
  "info": {
    "title": "BarCodeGenerator",
    "version": "1.0.0",
    "description": "Testing Barcode Generation via PowerApps"
  },
  "host": "tpgeneratebarcode.azurewebsites.net",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [],
  "produces": [
    "application/json" ,
    "text/plain; charset=utf-8"
  ],
  "swagger": "2.0"
}

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I also see this got added in the wrong forum, i'll move it over to the power apps section

View solution in original post

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you share more details on Form? Is it an EditForm on PowerApps?

How is your flow created? Please share more a screenshot of your flow?

Please make sure the corresponding response has been defined. Please check the doc on Connector definition for more details:

https://docs.microsoft.com/en-us/connectors/custom-connectors/define-blank#create-the-connector-definition

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Mabel, 

 

I was trying to follow an older article - 

https://powerapps.microsoft.com/en-us/blog/building-a-custom-api-for-powerapps-using-azure-app-servi...

 

 

 

the test for the connector succeeds but fails when being used in the form 

 

https://brakepartsinc-my.sharepoint.com/:i:/p/kevin_oliver/ESE58MWqrMRDiARhRGbBPSQBJk8CwTHrTLXpj_dkt...

 

The form has 2 text fields and a button, the button calls the function (UpdateContext({varOutput:BarCodeGenerator.RunThis(TextInput1.Text)}) ) Then the varOutput is set to the second text field. This all works fine with a static value, but fails when trying to call the RunThis() function from azure

 

https://brakepartsinc-my.sharepoint.com/:i:/p/kevin_oliver/EdivnpUe0nJAmFcZPhr469IB5axLjwyofOsi731vq...

 

Anonymous
Not applicable

I also see this got added in the wrong forum, i'll move it over to the power apps section

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,416)