Announcements
Hello guys,
I made a custom connector which returns me plain text.
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
hi @Anthony_Dob I'm facing the same problem. Did you find a solution ?Theo
@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_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
I believe this is the execution time of the actual script
@tchin-nin
I believe that it is the execution time of the script. Below MS documentationQ: 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
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 ?
I can not confirm if the execution time starts when the script is initiated or when the response is arrived in the script sorry
Your request that retrieve text/plain, can it take more than 5 sec to respond ?
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 395 Super User 2026 Season 2
Mohsin Ali 328
WarrenBelz 260 Most Valuable Professional