Deserialize Json to DataTable error

Hi, I’ve been trying to deserialize json into a datatable, but it’s still not working out. My json data is as below.

{
“result”: {
“list”: [
{
“atclNo”: “2435400759”,
“vrfcTpCd”: “OWNER”,
“atclNm”: “서신광진”,
“bildNm”: “106동”,
“tradTpNm”: “매매”,
“spc1”: “74.82”,
“spc2”: “59.98”,
“flrInfo”: “15/15”,
“atclFetrDesc”: “부분리모델링.빠른입주가능”,
“cfmYmd”: “24.07.18”,
“prcInfo”: “1억 2,300”,
“sameAddrCnt”: 7,
“sameAddrDirectCnt”: 0,
“sameAddrMaxPrc”: “1억 2,300”,
“sameAddrMinPrc”: “1억 2,300”,
“tradCmplYn”: “N”,
“atclStatCd”: “R0”,
“cpid”: “bizmk”,
“cpCnt”: 2,
“rltrNm”: “광진부동산공인중개사사무소”,
“direction”: “남향”,
},
{
“atclNo”: “2435304824”,
“vrfcTpCd”: “OWNER”,
“atclNm”: “서신광진”,
“bildNm”: “106동”,
“tradTpNm”: “매매”,
“spc1”: “74.82”,
“spc2”: “59.98”,
“flrInfo”: “2/15”,
“atclFetrDesc”: “샤시포함 부분 리모델링됨, 세입자 승계나 24년 4월 입주, 편하게 연락”,
“cfmYmd”: “24.07.18”,
“prcInfo”: “1억 4,500”,
“sameAddrCnt”: 6,
“sameAddrDirectCnt”: 0,
“sameAddrMaxPrc”: “1억 4,500”,
“sameAddrMinPrc”: “1억 4,000”,
“rltrNm”: “원탑공인중개사사무소”,
“direction”: “동향”,
}

I want to make the array data in the ‘list’ into a data table and store it in Excel. Perhaps because the ‘list’ is in the ‘result’, if you specify the value of dt as “Newtonsoft.Json.JsonConvert.DeserializeObject(jsonarray.ToString())” as an asset, the error continues.

Hi @ecosy6065

Can you refer the below thread,

Hope it helps!!

Hi @ecosy6065

1. Read Text File
   - FilePath: "path_to_your_json_file"
   - Output: jsonString (String)

2. Deserialize JSON
   - Input: jsonString
   - Output: jsonObject (JObject)

3. Assign
   - jsonArray = jsonObject("result")("list").ToString()

4.  Assign
   -dataTable = JsonConvert.DeserializeObject(Of DataTable)(jsonArray)


6. Write Range
   - Input: dataTable
   - Destination: "path_to_your_excel_file"

OutPut

Json

{
  "result": {
    "list": [
      {
        "atclNo": "2435400759",
        "vrfcTpCd": "OWNER",
        "atclNm": "서신광진",
        "bildNm": "106동",
        "tradTpNm": "매매",
        "spc1": "74.82",
        "spc2": "59.98",
        "flrInfo": "15/15",
        "atclFetrDesc": "부분리모델링.빠른입주가능",
        "cfmYmd": "24.07.18",
        "prcInfo": "1억 2,300",
        "sameAddrCnt": 7,
        "sameAddrDirectCnt": 0,
        "sameAddrMaxPrc": "1억 2,300",
        "sameAddrMinPrc": "1억 2,300",
        "tradCmplYn": "N",
        "atclStatCd": "R0",
        "cpid": "bizmk",
        "cpCnt": 2,
        "rltrNm": "광진부동산공인중개사사무소",
        "direction": "남향"
      },
      {
        "atclNo": "2435304824",
        "vrfcTpCd": "OWNER",
        "atclNm": "서신광진",
        "bildNm": "106동",
        "tradTpNm": "매매",
        "spc1": "74.82",
        "spc2": "59.98",
        "flrInfo": "2/15",
        "atclFetrDesc": "샤시포함 부분 리모델링됨, 세입자 승계나 24년 4월 입주, 편하게 연락",
        "cfmYmd": "24.07.18",
        "prcInfo": "1억 4,500",
        "sameAddrCnt": 6,
        "sameAddrDirectCnt": 0,
        "sameAddrMaxPrc": "1억 4,500",
        "sameAddrMinPrc": "1억 4,000",
        "rltrNm": "원탑공인중개사사무소",
        "direction": "동향"
      }
    ]
  }
}


Hope it helps!!