(Need Help) Formatting text as JSON - (Unexpected character ('\\' (code 92)): was expecting double-quote to start field name\n specified is unsupported or invalid")

I’m having trouble figuring out why bubble is accepting the value that is the output of the debugger but bubble can’t send the raw expression.

The error i’m receiving is derived from the line items field. - Raw error:

{“warnings”:null,“intuitObject”:null,“fault”:{“error”:[{“message”:“message=BadRequest; errorCode=003202; statusCode=400”,“detail”:null,“code”:“3202”,“element”:null}],“type”:“VALIDATION”},“report”:null,“queryResponse”:null,“batchItemResponse”:[],“attachableResponse”:[],“syncErrorResponse”:null,“requestId”:null,“time”:1670425007723,“status”:null,“cdcresponse”:[]}

it works in Postman. It is not a problem with the actual API setup or execution. If you look at the value in the debugger workflow that is then formatted as text, it shows the text output of the “Format as Text” value in the workflow. I have copied the formatted text straight from the debugger and then directly pasted it into the “Lineitems” key field in the Bubble editor, and the API runs successfully in Bubble.

It appears that the API workflow is failing, but the same formatted JSON from the debugger works successfully. This makes it difficult to debug. How can I resolve this issue?


Don’t press enter between each line items new key. Act as if it’s all 1 sentence


Thanks that worked!

1 Like

Having this same issue. My API call is correct, but I can only call it as static text rather than using dynamic data.

For example, I format the data as text and the output is as expected:

But this throws an error with my API. However, if I copy that :format as text from the debugger into the API call workflow and run it again as a test, it works fine, even though the content for both is exactly the same.

I’ve been going over this for hours and am almost losing it so any advise appreciated :grinning_face_with_smiling_eyes:

There’s probably a newline or something nested in there maybe? I think taking that text and let’s say you used postman, it should work. It’s just the way bubble is handling newlines. you just have to keep ‘typing’ as if it’s one long, run-on sentence. lol

So is Bubble inserting \n in there when format as text is used?

Yes they do

1 Like

Thank you @doug.burden for this…helps me a ton and lets me not pester the API providers support staff.

BTW, has anybody lodged a Bug report with Bubble about this issue? @Benjamin_Rodgers @georgecollier

Seems like something that Bubble should fix.

Feels like it’s probably an ‘expected behaviour’ but one that isn’t well documented or at all useful. Format as text should have a checkbox that makes each item JSON-safe or something…


In my experience, Bubble’s API connector can be the most challenging and unstable aspect of the software, albeit also the most rewarding when it works correctly. As for logging a bug report @boston85719, I’m unsure what exactly to include because the issues seem so fundamental. Even if they address some aspects, I worry it could still fall short or, worse, disrupt my existing connections. It’s an area where Bubble could definitely invest more effort in improving, given its vital role in app development.

1 Like