cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tzavertnik
Level: Powered On

custom connector returns value of true and not the body

I have created a custom connector that triggers a Microsoft Flow. I am able to trigger the Flow with no problem. However, I try to return data back to PowerApps via the Response action in Flow and the data in the Body is not accessible in PowerApps. When I test the connector in the Custom connectors screen the data appears in the body. However, when I try to load it in PowerApps, I only get a value of true. 

 

I have tried loading response into a collection and variable. It always returns true. Any help or direction is appreciated.

 

Below is the response that is returned in the body:

{
  "pdfURL""/PowerQuestionAgendasFiles/GeneratedAgendas/Client name_2017-12-06T23_08_01.8729379Z.pdf"
}

5 REPLIES 5
Community Support Team
Community Support Team

Re: custom connector returns value of true and not the body

Hi @tzavertnik,

 

"

However, I try to return data back to PowerApps via the Response action in Flow and the data in the Body is not accessible in PowerApps

"

Could you please share more details about how you configured the Response action in Microsoft Flow, also for the custom connector, how you add the response back in it?

 

If the response in PowerApps testing works, then it should work in App running mode.

 

For example, if the function in Custom connector in configured as GetResponse, then to get the value, please take a try with the code below:

Connector.GetResponse.value.pdfURL,

Or 

Connector.GetResponse.Body.pdfURL

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: custom connector returns value of true and not the body

Hi @tzavertnik,

 

Any update on this?

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tzavertnik
Level: Powered On

Re: custom connector returns value of true and not the body

@v-micsh-msft - Sorry for the delay. I missed one crucial step and that was defining the response parameters for the custom connector. Thank you for providing that guidance.

 

Tim

Highlighted
meqt
Level: Power Up

Re: custom connector returns value of true and not the body

Hey @tzavertnik

 

sorry for bothering. where did you define the response parameters? in the custom connector only?

I'm asking because i have the same issue as you did. I defined the response with an example in the custom connector portal. When downloading the swagger definition everything looks fine.

 

The only property i can access in PowerAppst is Value (not Body) and it should hold an List of Objects but it contains "true".

The very same definition works for logic apps without any problems at all. Maybe you find the issue.

 

I am pretty confident my response definition is correct but maybe my usage is off.

 

Thank you!

 

Greetings

 

_________________________

response definition:

 

        "responses": {
          "200": {
            "description": "Success operation"
          },
          "default": {
            "description": "default",
            "schema": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "ID": {
                    "type": "number",
                    "format": "int32",
                    "description": "ID",
                    "x-ms-summary": "ID",
                    "title": "",
                    "x-ms-visibility": "advanced"
                  },
                  "NAME": {
                    "type": "string",
                    "description": "NAME",
                    "x-ms-summary": "NAME"
                  }
                }
              }
            }
          }
        },


Call

 

ClearCollect(User;UserFunctionCon.GetUserList())
tzavertnik
Level: Powered On

Re: custom connector returns value of true and not the body

@meqt

 

Sorry for the delay. I actually copied the body response within the custom connector in the definition section.

 

In the response area, you should have the 200 response defined based on your swagger file.

CaptureResponse.PNG

 

If you click on that entry, the details will be loaded. In the upper corner, there is an "Import from sample" button.

 

CaptureResponseImportButton.PNG

 

When you click on that, a new window will open which will allow you to paste the expected json body response structure that will be returned from your service.

CaptureResponseImportBody.PNG

 

Click on "Import" and all of those items should appear in the Body section.

CaptureResponseImportBodyTokens.PNG

 

If remember correctly, you will need to create a new connection for the new tokens to be recognized and you would need to update the PowerApp.

 

Hope this makes sense and helps.

 

Tim