Json Deserialization Error
Question
Application Type
Reactive

Hi,

I am trying to deserialize the data in json format but unable to achieve,

I am attaching OML with sample response init, Please suggest where I went wrong .

Error : "Failed to deserialize JSON to JSONLOAD_SampleDatumList: Could not convert '[object Object]' to List",

Thank You,

Saikumar Appana.


HospitalPOC (1).oml

Hi Saikumar, 

If you have not tried the Forge component "ardoJSON", please give it a try.


Link for the Forge Component
https://www.outsystems.com/forge/component-overview/413/ardojson

Link to the Documentation of the component:
https://jnb.outsystemscloud.com/ardoJSONReactiveDemo/JSONPath

The server action "JSONSelect" will accept JSONPath to fetch the specific value

Based on the JSON you have shared, I have tried a sample and got the result.


I have attached the OML file for your reference. 
If this is not what you have expected do let me here. 


testapp.oml

Thank you, KavinIlammurugu


Solution

Hi @Saikumar Appana ,

I have tried your sample and changed the list to a normal structure and it's working and I have attached OML for your reference. hope this solution helps you

https://developergeekay.outsystemscloud.com/HospitalPOC/Home?_ts=637940226066758430

HospitalPOC.oml

Thank You, Gee Kay

Do you have JSON in normal format? I mean other than the way Outsystems accepts!

Hi,

Sorry I didn't get your point,

I just included sample response from rest API in sample oml.

Hello @Saikumar Appana,

Have you got your solution? If not then, please read this discussion once, 
https://www.outsystems.com/forums/discussion/59994/i-am-unable-to-deserialize-a-json-data/  

this might help you.


Thanks,

Shriyash

Thank you for you're response.

yes, I gone through it before, but not resolved my issue.

Hi,

I tried with above approach but not Successful


Json Sample:


"{""ColumnMetadata"":[{""isCaseSensitive"":false,""isCurrency"":false,""isSigned"":true,""label"":""count"",""length"":0,""name"":""count"",""nullable"":1,""precision"":19,""scale"":0,""schemaName"":"""",""tableName"":"""",""typeName"":""int8""}],""Records"":[[{""longValue"":41}]],""TotalNumRows"":1}"


Need to capture LongValue: 41 in a variable.

Thank You.

Hello Saikumar,

I have looked into your sample JSON response and looks like you have used double quotes twice into it. So, please replace all the double quotes ("") with one double quote (") and then try again.

Thanks & Regards,

Sachin

yes, I tried that as well but Same issue.

Now I am using this sample: 

{"ColumnMetadata":[{"isCaseSensitive":false,"isCurrency":false,"isSigned":true,"label":"count","length":0,"name":"count","nullable":1,"precision":19,"scale":0,"schemaName":"","tableName":"","typeName":"int8"}],"Records":[[{"longValue":41}]],"TotalNumRows":1}


Thank You.

Hi Saikumar, 

If you have not tried the Forge component "ardoJSON", please give it a try.


Link for the Forge Component
https://www.outsystems.com/forge/component-overview/413/ardojson

Link to the Documentation of the component:
https://jnb.outsystemscloud.com/ardoJSONReactiveDemo/JSONPath

The server action "JSONSelect" will accept JSONPath to fetch the specific value

Based on the JSON you have shared, I have tried a sample and got the result.


I have attached the OML file for your reference. 
If this is not what you have expected do let me here. 


testapp.oml

Thank you, KavinIlammurugu


Solution

Hi @Saikumar Appana ,

I have tried your sample and changed the list to a normal structure and it's working and I have attached OML for your reference. hope this solution helps you

https://developergeekay.outsystemscloud.com/HospitalPOC/Home?_ts=637940226066758430

HospitalPOC.oml

Thank You, Gee Kay

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