In my spreadsheet, I have a formula that hyperlinks a calendar event. It looks like this in the sheet:
=HYPERLINK("https://www.google.com/calendar/u/0/r/eventedit/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","View Invite")
In my script I want it to analyze that cell and split it to specifically grab the XXXXX portion through base64 decode. Then, in that decode is the event ID and the calendar ID, and I want the event ID specifically.
var viewInvite = sheet.getRange(index, 13).getValue();
var beginningPiece = '=HYPERLINK("https://www.google.com/calendar/u/0/r/eventedit/';
var endPiece = '","View Invite")';
var splitEventId = Utilities.newBlob(Utilities.base64Decode(beginningPiece.split("=")[1])).getDataAsString().split(" ")[0];
Logger.log(splitEventId);
How do I grab the event ID from the formula? I tried to work a scenario like above but I can't figure it out