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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom connector not a...
Power Automate
Answered

Custom connector not able to handle different response types

(0) ShareShare
ReportReport
Posted on by 22

Hi all,

 

I creating a custom connector in Power Automation.

The response type of a value from an api function which I call is different. Some properties returns an empty «GlobalValues» and other returns an array of values.  As you can see, some properties can have a GlobalValue and others not. The response which I get is like that:

tho1971_0-1609840381031.png

 

My swagger looks as follow :

tho1971_1-1609840381037.png

 

If I call the function in flow, I get an error:

The API returned an invalid response for workflow operation 'Get_document' of type 'OpenApiConnection'. Error details: 'The API operation 'GetDocument' requires the property 'body/GetDocumentResult/Properties/0/GlobalValues' to be of type 'String' but is of type 'Array'.

 

I think the problem is the empty GlobalValue property. Is there a way I can change the response definition (swagger) so that the response can be an array or a string?

 

All advice appreciated!

Categories:
  • Verified answer
    Gopala_Krishna Profile Picture
    1,495 on at

    @tho1971 

     

    You can try specifying it as [array,string] this way we are indicating the flow that the response can be of either type it can be of type array or can be of type string.

     

    If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved.

  • tho1971 Profile Picture
    22 on at

    Hi Gopala

    It works. Thanks for your help!

    regards.

  • tho1971 Profile Picture
    22 on at

    Hi Gopala

    It works fine for me. Thanks for your help!

    regards.

  • DereckRadford Profile Picture
    4 on at

    We are running into a similar issue do you have an example of how you solved this.

     

    Here is an example of our connector and the customFields value contains some with boolean, string, integer and it seems to freak out when doing this.

     

    SNAG_IMG_DERECK-WLT_20230370.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard