How to take the data in typescript from json object?

Friends,
When I alert using statement

alert(JSON.stringify(this.param1));

I got result as

[{"numBuildingID":"30172010000829","numZonalID":"3017201","intWardYearID":"2013","wardname":"( 1 ) വിളക്കുളം","intDoorNO":"90","chvownerEng":"Beevi Pathumma","chvAssessEng":"ARV","ptaxold":"130","lcold":"7","surold1":"0","servold":"0","ptaxtotalold":"137","area":"64","chvFunctionalityMal":"പാര്‍പ്പിടാവശ്യം","chvStatusEng":"Approved","form6status":"Approved","ptaxnew":"130","lcnew":"7","sernew":"13","surnew":"0","ptaxtotalnew":"150","wardnameeng":"( 1 ) VILAKULAM","chvOfficeNameEng":"Main Office","intWardNo":"1","chvRemarksForm6":"--","isDemolished":"0","intDemolishedPeriod":"0","chvCategoryEng":"Authorised","intLBID":"172","Column1":"Varkala Muncipality","intBuildingCategory":"1","Column2":"1. Beevi Pathumma ()","chvWardNameEng":"VILAKULAM","bitIsCurrent":"1"}]

From this i need to take the value of ‘numBuildingID’,‘intBuildingCategory’ in two variables.

How it can done ?

Please advise

Thanks

Just get the variables from this.param1

let numBuildingID = this.param1.numBuildingID;
let intBuildingCategory = this.param1.intBuildingCategory;

Dear @MattE

I got that values as ‘undefined’ now.
Actually that values passed as JSON.parse (i mean object)…
please advise

Can you show to code you use for this?
Most likely you made an error there (maybe a typo)

payTax(){

  alert(JSON.stringify(this.param1));
  let numBuildingID = this.param1.numBuildingID;
  let intBuildingCategory = this.param1.intBuildingCategory;
  alert("id is: "+numBuildingID); //undefined here 
  
}

No comments ?

What’s the output when you add this line to the top of payTax()?

console.log(this.param1);
and
console.log(this.param1.numBuildingID);

Ow wait, I know!

this.param1 is an array, not an object.

this.param1[0].numBuildingID will work.

Thanks dear you saved me …

:sunglasses:

Great!
Now mark the thread as solved, so other people see this thread has a solution.