Having an issue while trying to access a specific node from a JSON result obtained using the MSSQL npm package with an Azure Database. Despite the results being in valid JSON format, attempts to use bracket or dot notation to access the data have been unsuccessful and returned 'undefined'. Here's a snippet of what is being returned, with my goal being to access the personalNames node: [ { 'JSON_F52E2B61-18A1-11d1-B105-00805F49916B': '{"personalNames":[{"id":"H0AK00014","name":"WHITTAKER RICHARD"}} ]
req.query("SELECT TOP 3 CAND_ID AS id, REPLACE(CAND_NAME, '\"', '') AS name FROM [dbo].[Merge_FEC_80_18] FOR JSON PATH, ROOT('personalNames')")
.then(function (recordset) {
console.log(recordset.recordset[0].personalNames);