ERROR passing :formatted as JSON_safe

I have a review form where the text field has this format:
”Input Commentarios’s value:formatted as JSON-safe”

However, it returns the following error:

{
  "error": {
    "code": "InvalidRequestContent",
    "message": "The request content is not valid and could not be deserialized: 'After parsing a value an unexpected character was encountered: \". Path 'survey_comments', line 4, position 1.'."
  }
}

image

image
My API Connection:

Hey @paula.sucla

Welcome to the Bubble Community! :tada: :confetti_ball:

Check your API Connection, maybe you are already adding the ““ and need to remove them from the API connection.

JSON safe always adds “ “ around the values.

Hope that helps. :blush:

My API Connection:

Are you sur this is the only part that create issue? missing value for example could break your JSON.

Send your request to an endpoint like beepceptor and inspect your JSON.

I think the part that is breaking is like what @Jici said. Try not having the ‘allow blank’ checked. Pass through each value and see if it works, then maybe just don’t send a key value pair if you don’t have one. Or send null if you need to. I usually handle the ‘allow blank’ in the workflow instead of relying on that checkbox. :blush:

1 Like

I’m pretty sure the problem comes from the survey_comments field, because when I make a request using “” twice in the field, I get the same error that appears to the client.

What you have set for comments in your last screenshot is not correct and should be "TESTE"

So for that field, use one set of quotes, then in the workflow you can do the ‘JSON safe’ and it will add the quotes for you. Try it like that and see if it still gives you the error now that the ‘Allow blank’ is off.

1 Like

exactly, the correct thing would be “TESTE”, but that’s exactly how my request is reading this value, as if it were ““TEST””

You have a screenshot earlier

That show the hello correctly.

I don’t understan what you mean by

Which request? in API connector? in workflow?

“Hello” represents the value being sent, but I gave the example of ““TESTE”” which is how the request is interpreting the data

How do you check the data request exactly? can you explain? maybe record a screencast that show API connector, workflow settings debug_mode when you run it…