cannot run "Export Google Inbox Reminders To JSON"

This is a publicly published program which I assume worked when it was published 3/30/19.

I get the following message,
TypeError: Cannot read property ‘innerText’ of undefined

I followed the instructions exactly. It’s a simple program, and would do what I need if I could figure out how to make it work. Anyone else use Google Reminders that could try it?

It looks like it’s having an “origin policy / cross domain” issue as the HTMLSpanElement has innerText: [forbidden].

I’m no expert on this and found that removing the last .innerHTML from the keyValueToArray function kind of fixed the issue.

function keyValueToArray (attribute) {
  let attributes = [ ...attribute.children]
  let k = attributes[0].innerText
  let v = attributes[0].innerText === "Recurrence info" ? [...attributes[1].children].map(keyValueToArray) : attributes[1]

  return [k, v]
}

The unnamed cell with the code below now has the reminder object.

_.groupBy(reminderObjects, x => x.State === "upcoming" ? (x["Due date"] === "unspecified" ? "someday" : (x["Recurrence info"] ? "recurring" :"upcoming")) : x.State)

I hope that helps.

Thanks. It does ‘kind of work’ - at least it runs and I can see the values of the arrays if I expand them.

But, WHAT GENERATES a .JSON file? I don’t see any output I can save.

JSON.stringify

  JSON.stringify( _.groupBy(reminderObjects, x => x.State === "upcoming" ? (x["Due date"] === "unspecified" ? "someday" : (x["Recurrence info"] ? "recurring" :"upcoming")) : x.State));

@ hellonearthis
I really appreciate your prompt replies, but this problem just buried me.

Apparently the original author ASSUMED a lot! He titled it “to JSON”, but didn’t include that code.

Now I’m stuck on interpreting the date string. Nothing I’ve tried yields an actual date. You have any ideas?

Each cell which contains an object or array can be downloaded as JSON. This is an Observable feature and requires no additional code:

1 Like

I would recommend asking the author in a comment on that notebook if he could help. You can just add a comment right in the title of the notebook like so: