154
Views
9
Comments
Unexpected character was encountered After parsing a value : "
Application Type
Traditional Web

Hi Team,

I am facing an error while deserializing JSON i.e. "Failed to deserialize JSON to Struct_xyz:
After parsing a value an unexpected character was encountered: ".

Does anyone have a clue on where to look for? 

Thanks in advance.

2020-02-05 04-54-55
Changalrao Bairaboyana

Hello @RUPAL AGRAWAL 

You would need to make sure the structure can hold the value of compatible data type.

 https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/implementing_logic/logic_tools/json_deserialize/

2021-10-08 05-01-12
Deepa Tiwari

Hi @RUPAL AGRAWAL ,

Can you paste your json and structure format. May be in json is not correct format thats why getting this issue. 

Or may be your structure is not the same as json.

Can do one thing copy your json and create a structure from json after that you are able to deserializing json proper.


Thanks

Deepa

2021-01-04 08-13-48
Toto
 
MVP

Yes, that usually the JSON format have incorrect format.

Try to get the JSON value and check it using JSON checker (ie : https://jsonformatter.org/)

UserImage.jpg
Rupal Agrawal

Hi,

Actually the string that we are trying to parse is ^a-zA-Z0-9_.#$&()!{};,?/*C%:+=[|]'-@abcd"" , This string is coming from a PDF document. On upload of PDF document, We have to allow every special character to parse and exact same string should be visible on screen.  But double quotes is causing an issue. Structure seems correct in my case.

2021-01-04 08-13-48
Toto
 
MVP

Double quote ("") is escape character in Outsystems for quote (")

UserImage.jpg
Rupal Agrawal

Yes, but is there any way to make it work in order to parse double quotes?

2021-01-04 08-13-48
Toto
 
MVP

You can tried use quadruple quote ("""") so this will meaning escape for quote twice ("")

UserImage.jpg
Rupal Agrawal

I tried Replace(Value ,"""","""""") but its still encountering an error.

2021-01-04 08-13-48
Toto
 
MVP

Can you create mini app that have this problem, I'll check it.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.