Can I view and edit Google Calendar events in a Google Sheet? - google-apps-script

I am able to create Google calendar events from a Google sheet. I want to know if I can view and edit Google calendar events in a Google sheet.
I have read the following, but I am unsure if it will do what I want...
"Allows a script to read and update the user's Google Calendar. This class provides direct access to the user's default calendar, as well as the ability to retrieve additional calendars that the user owns or is subscribed to.

Yes you can.
Query the calander to get the events (with the event id)
Write to the sheet
Have some logic in the sheet, like a dropdown with status (update/delete/untouched/create)
Do your thing in the sheet and then call the function
Based on the dropdown status call functions ti handle the logic that comes with the status.
Reset the dropdown in the sheet / delete the row?
That would be the high over logic.

Related

Automatic table to create a list of specific inputs

I'm trying to create a Google spreadsheet, with the start of the table a pop up window comes with a question of whether it is an Entry or Pickup.
After the decision, it should fulfill certain tasks after the election.
When choosing an Entry, a form should appear where you have to provide certain information. (The entered information should also be automatically inserted on the Google Table by the script.)
When selecting a Pickup, another form will appear that compares the information entered with the list of Google Sheets.
And upon successful approval, it should fullfill on the list in the Pickup section.
My question is whether it is possible with Google Drive to create such a script.
My question is whether it is possible with Google Drive to create such a script.
Yes.
You can create such a script with Google Sheets with Apps Script by using UI Modals. Create a HTML Form on these modals and when the submit button is pressed send the data to a custom function that places the data on your sheet.
You can have this executed when the file is opened thanks to Triggers.

Track "copy to my calendar" of shared google calendar events using Apps Scripts

I own a calendar which is shared with a certain number of people (subscribers). I would like to keep track of which events the subscribers add/copy to their personal calendars. The calendar is created by a spreadsheet using Apps Scripts and I have full access on anything needed. The emails of the subscribers are known but I can't access info on their side.
I would be happy with a boolean of a kind showing if an event has been copied, but if that's possible then I believe I'll be able to also count which and how many subscribers copied which events.
No, the Calendar API doesn't have any way to obtain if and event was copied. In any case, the event copy option is just a template from the original event that can be completely modified before being created.

Communicating between Google Calendar, Google Forms and Google Spreadsheets

Consider a Google Calendar scenario with various rooms that can be booked. Users will be browsing the different rooms and can create an entry in one of the free slots. The basic default properties provided by the Google Calendar are not sufficient for the business scenario but I haven't found a way to add more fields: the default new event form does seem to be customisable. Is this so?
My idea was to provide a Google Form to cover the rest of the details.
The process would look as below:
The user browses the different rooms and finds an available slot. The calendar entry is created with the basic details. The entry is added into the calendar and the details are recorded into a Google spreadsheet.
The user receives an email with another google form: the ID of the appointment would need to somehow be passed as parameter. The google form will be used to insert the "advanced details" into the spreadsheet.
An interface will be created to view the spreadsheet data in a more structured and user friendly manner.
Can something like this be done using Google Calendars, Google Forms and App Script? Any pointers where to start from? Or if not, how the process could be changed to be actually possible. The only starting points I found were Add ins which create calendar entries directly from Google forms, but this would require the user to start from a form, rather from the calendar, which I would not rather go for, not at least until I know there's no other way.

Update Google Forms field based on dynamic data from a Google Sheets spreadsheet

In a Google Form we have a pull down selection list.
The list of items may change from minute to minute. The master copy of the data is in a column in a google docs spreadsheet.
When a user accesses the form, we want them to see the latest copy of the pull down list as is current in the spreadsheet.
I don't see an obvious way to do this with triggers. onOpen, for example, only triggers for administrators of the form, not users. Is there a way I can keep this form up-to-date automatically?
This is my first time in google docs, but I'm very experienced in excel scripting.
The work flow needs to be a bit different than what you've described. Since there is no ability for Google Apps Script to interact with an end user accessing a Form, there's no way to react to that. However, you can react to changes in the spreadsheet, and update the form options in preparation for the next end user.
Depending on how the options get updated in the spreadsheet, you can use an installable trigger there, to react to an edit or a change.
If the form is associated with the spreadsheet containing the choices, you can get a handle on the form using Spreadsheet.getFormUrl(), then pass the URL to FormApp.openByUrl(). Otherwise you will need to provide the ID or URL explicitly to FormApp.openById() or .openByUrl(), respectively.
That spreadsheet trigger function can modify the available selections for the relevant question by using ListItem.setChoices() or ListItem.setChoiceValues().

Google Sheets : format a cell differently based on user viewing the sheet?

Is it possible to format a cell (set the background color, for instance) based on the user currently viewing the sheet?
I'm using Google Sheets for an employee scheduling application and would like to highlight the name of the employee currently viewing the sheet everywhere that name appears on the schedule.
So if Tom opens the sheet, all cells with "Tom" in them would appear highlighted. If Bob opens the same sheet, all cells with "Bob" in them would appear highlighted.
Thanks in advance!
According to Google Apps Script:
getActiveUser()
Gets information about the current user. Returns a User object
describing the current user. In limited-privilege executions (such as
in response to onOpen or onEdit events), we only return the identity
of the active user if both the user and the script owner are part of
the same domain. This is to protect the privacy of consumer users, who
may not want their email address exposed. For more information, see
the active user entry in the Glossary.
So if you have someone using the spreadsheet from within your domain (for business, education), then you could have an onOpen script and attempt a filter/highlight function based on your parameters and script.
Cheers!
You could create specific filter views for your team. Select Data > Filter Views and name your filter view after the teammate. Filter views allow different people to view the same sheet differently. I may be wrong about this, but I don't believe there is a way to turn the filter views on and off programmatically through GAS, but each filter view has a unique URL, so you could use getActiveUser() in conjunction with an alert prompt linking the active user to their personal filter view.