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 Apps / Convert Custom Connect...
Power Apps
Unanswered

Convert Custom Connecto GET Request response from text/plain to JSON

(0) ShareShare
ReportReport
Posted on by 559

Hello guys,


I made a custom connector which returns  me plain text.

Anthony_Dob_0-1651312076839.png

 

When trying to call this request inside my Canvas App I get the 'The data returned in the response is invalid. Response should be a valid JSON Object'. Is there any way to convert the plain text response to JSON? Or any work arounds for this?

 

Best Regards,

Anthony

Categories:
  • tchin-nin Profile Picture
    779 on at

    hi @Anthony_Dob 
    I'm facing the same problem. Did you find a solution ?
    Theo

  • AnthonyD Profile Picture
    559 on at

    @tchin-nin ,

     

    Yes i fixed this by adding code to the custom connector which transforms the plain text to JSON before returning the response. This is added in public preview since august last year. Info can be found here .


    If you need assistance on converting your plain text to JSON. Let me know i'll be glad to help you.


    Best regards,

    Anthony

  • tchin-nin Profile Picture
    779 on at

    @Anthony_Dob 
    Thanks for you quick answer 🙂

     

    I saw this method, but my understanding is that my HTTP request can not take longer than 5 sec which is a problem for my usecase.

    Maybe I misunderstand the maximum of 5 sec for executing the C# script. Does it include the custom connector operation execution time ?

     

    Theo

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I believe this is the execution time of the actual script

  • AnthonyD Profile Picture
    559 on at

    @tchin-nin 

     

    I believe that it is the execution time of the script. Below MS documentation

    Q: Are there any limits?
    A: Yes. Your script must finish execution within 5 seconds and the size of your script file can’t be more than 1 MB.


    If this still would be the problem look at this solution: API => API Management (with custom code in the response policy) => custom connector


    Best Regards,

    Anthony

  • tchin-nin Profile Picture
    779 on at

    As the script awaits for the http request to respond, if my request take more than 5 sec to respond, my script will time out. Well this is my understanding, but I'm running some test to confirm.

    Unless you can confirm otherwise  ? 

  • AnthonyD Profile Picture
    559 on at

    I can not confirm if the execution time starts when the script is initiated or when the response is arrived in the script sorry

  • tchin-nin Profile Picture
    779 on at

    Your request that retrieve text/plain, can it take more than 5 sec to respond ? 

  • AnthonyD Profile Picture
    559 on at

    No, it's not that many data to process so never hits that limit

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard