Hey all. I’m trying to update my Google Sheet tracker to pull the new data provided with the node monitoring tool. I wrote up the following script, which pulls all the data in just fine. But when I try to break it up into different cells, it returns nothing. What am I missing here?
function myMonitor() {
//GET PUBLIC VALIDATOR KEY
var sh=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“NODEINFO”);
**var rowNum = sh.getRange(‘F6’).getValue(); **
//POST NODE STATUS QUERY
** var url = “http://monitor.incognito.org/pubkeystat/stat”; **
** var data = { “mpk”: rowNum**
** };**
** var options = {**
** ‘method’ : ‘post’,**
** ‘contentType’: ‘application/json’,**
** ‘payload’ : JSON.stringify(data)**
** };**
** var response = UrlFetchApp.fetch(url, options);**
** var txt= response.getContentText();**
** var d=JSON.parse(txt);**
//RETURN RESULTS BACK TO GOOGLE SHEET
var sh1=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“MONITOR”);
sh1.getRange(1, 1).setValue(d);
}
Result:
{Role=PENDING, AutoStake=true, SyncState=SHARD SYNCING, Alert=true, CommitteeChain=2, VoteStat=[Ljava.lang.Object;@1db148d2, NextEventMsg=12 epoch to be COMMITEE, Status=ONLINE, MiningPubkey=}
Now if I try the same thing, and switch the last line to:
sh1.getRange(1, 1).setValue(d.NextEventMsg);
it returns nothing. Any ideas?