BHAGWANJI JHA

BHAGWANJI JHA

  • NA
  • 25
  • 970

how to extract json object in .net (business central to .net)

Dec 10 2020 11:57 PM
 
 
I want to just show only message:" " not whole part of error. 

Answers (3)

0
Kiran Mohanty

Kiran Mohanty

  • 486
  • 2.8k
  • 310.1k
Jan 11 2021 11:56 AM
First you can de-serialize it and then pick the actual property you wish to display. 
  1. try{  
  2.   var result = JsonConvert.DeserializeObject<PO>(input);  
  3.   return result.message;  
  4. }  
  5. catch (Exception ex){  
  6. }  
 
0
BHAGWANJI JHA

BHAGWANJI JHA

  • 0
  • 25
  • 971
Jan 11 2021 11:20 AM
I had been done it. thanku sir
0
Nitin Sontakke

Nitin Sontakke

  • 135
  • 13.6k
  • 14.9k
Dec 11 2020 12:10 AM
To the best of my knowledge, there is no way to do it.
 
You will still need to deserialize entire json, create an object out of it and then access the property that you want.
 
May be you will do all of this in one line, however, for the computer, I don't believe there is a way to go around it.