RJ_Kadari
(Raju Kadari)
1
can anyone help , how to read values from below formatted json ? we need to read mappings.name from below.
{
“id”: “123124”,
“MetaID”: “235346”,
“logID”: “23694”,
“data”: [{
“ForcedFIelds”: [{
“label”: “FirstName”,
“Value”: “xyz”,
“Mappings”: {
“name”: “FirstName”,
“datatype”: “String”,
“elementType”: “Input”
}
},
{
“label”: “LastName”,
“Value”: “abc”,
“Mappings”: {
“name”: “LastName”,
“datatype”: “String”,
“elementType”: “Input”
}
}
],
“FIelds”: [{
“label”: “City”,
“Value”: “palakollu”,
“Mappings”: {
“name”: “City”,
“datatype”: “String”,
“elementType”: “Select”
}
},
{
“label”: “StateID”,
“Value”: “NY”,
“Mappings”: {
“name”: “StateID”,
“datatype”: “String”,
“elementType”: “Select”
}
}
]
}]
}
rkelchuri
(ER.Krishna)
2
consider your JSON file as text file and use above code to read all text.
Hope it will work.
aksh1yadav
(AKSHAY YADAV)
3
Follow the available solved thread on the forum please:
Regards…!!
Aksh
2 Likes
asishkumar
(Asish Kumar Behera)
4
Hi Kadari,
You can use the select clause on a JSON array object.
In Below example I am searching one record from the JSON array having CustomerID==102.
Ex. objJsonArray.SelectToken(“$.[?(@.CustomerID==102)]”).ToString()
Thanks,
Asish