cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mysticode
Frequent Visitor

Error of "Http request failed: the content was not a valid JSON." when using REST to JSON connector

Error of "Http request failed: the content was not a valid JSON." when using REST to JSON connector. The body result contains CDATA formatting, and this custom connector's action's schema property is set to "String" type, with no specific "Format". I tried a format of "Binary" as well, and the same error occurred.

 

Why is the Flow trying to parse the result from this action's body result's string value? Can it not just return as a normal string and not be parsed by the flow?

2 REPLIES 2
manuelstgomes
Super User
Super User

HI @mysticode 

 

Is there a way for you to share an annonimized sample of your JSON so that we can take a look?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

When this returns with "Value" being blank, my custom connector Method returns without any errors:

 

{
    "statusCode": 200,
    "headers": {
        "Cache-Control": "max-age=0, private",
        "Date": "Tue, 15 Sep 2020 21:43:52 GMT",
        "X-AspNet-Version": "4.0.30319",
        "Content-Length": "447",
        "Content-Type": "application/json"
    },
    "body": {
        "projectRespondentResponseGetResponse": {
            "projectRespondentResponseGetResult": {
                "methodname": "ProjectRespondentResponseGet",
                "result": {
                    "success": true,
                    "id": "00000000-0000-0000-0000-000000000000",
                    "value": "",
                    "errors": []
                }
            }
        }
    }
}
 
 
However, if "Value" returns with the actual data I want, it causes the Flow error that I mentioned originally:
<![CDATA[{"answers":[{"answercompl":"","answertext":"","detail":"","element":"First Name:","idelement":"","progid":"","rowsorter":-1,"sorter":1000008,"subdetail":""},:""}
]]>
 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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 (2,406)