Create a event with "Out of Office" - scripting

When I create a event in my calendar I have the option "Out of Office". How I can create a event about GScript with the function "Out of Office"?
Here you can find my current sheet incl. my script: https://docs.google.com/spreadsheets/d/17zdmhWr9EUrY_-6ZVrYWggf5kAnvEhKGdGsJbxW7Px4/edit?usp=sharing
How can I add the command? or is there a feature which I do not know?

Answer:
Unfortunately, in its current form, this isn't possible through the Calendar API.
More Information:
Google Apps Script and the G Suite service integration it provides are effectively wrappers for the already existing APIs for the services they connect to (Calendar, Sheets, Docs, etc). As a result, given that the feature is not available through the API, Apps Script does not have this ability either.
Feature Request:
I did a search on Google's Issue Tracker and there are a couple of highly requested Feature Requests for the creation of Out of office events through the Calendar API already.
You can find these Feature Requests here and here, which you can give a star (☆) in the top left to let Google know more people wish for this request to be implemented.

Related

Hubspot -> Zapier -> Google Sheets

Trying to work out a zap and need some assistance..
I'm wanting to use the zapier scheduler, and at a time chosen, export contacts in a hubspot list to a google sheet..
effectively, exporting a list to a google sheet, but only processing daily.
i can only seem to do it, running a scheduler then when a new hubspot contact is created...
any thoughts?
TIA
Do you have HubSpot Professional or Enterprise (Marketing, Sales, Service or Operations)?
If you have, you can do that in two ways:
Using Google Sheets app from HubSpot's Marketplace and HubSpot's Workflows (HubSpot Professional required).
Sending a webhook to Zapier and then doing the other Zapier automation (HubSpot Enterprise required).
Personally, I would recommend the first one. With HubSpot's Workflows, you can set timers and delays to do that just once per day.
If you don't have HubSpot Professional or Enterprise to use Workflows, I would recommend setting a trigger at Zapier. Can be anything you desire, like when Contact ID is known or something like that - in this case, Zapier will be triggered just after the contact has been created.

Searching for plug-in or API call for dynamic titles in recurring events

I'd like to create a set of recurring events but with a dynamic titles, e.g. for counting gym lessons... Is there a way to do this in Google calendar or is there a free or cheap alternative available?
This seems hard to do without scripting it via the Google Calendar API. You can set up the initial recurring event and then iterate over the sequence of other calendar events for that instance using the following endpoints:
Retrieve instances
Update event
I can't think of any other free services that assist with this off the top of my head.
If you'd like similar functionality across other calendaring systems including Outlook and Exchange without having to re-do the implementation with each of those APIs, you can also check out my company Kloudless's unified Calendar API (docs), which provides an abstraction layer for operations such as the ones above.

Using Google Calendar Web API to dynamically create events on (company) calendar?

I've reviewed the Google Calendar API docs and having trouble finding information on creating events on a predefined calendar.
The Browser Quickstart docs worked just great to get up and running by authenticating use of my calendar. However, do you have advice on how to allow users to create events on a predefined calendar?
Use case:
We have a couple web forms for users (leads) to complete. When certain criteria have been met, we'd like to pass details from the web form to a Google Calendar event on our company calendar.
User completes web form which includes a handful of questions, namely two date/time pickers
On form submission, deliver form values to Google Calendar API - create event dynamically using information submitted in the form
Standard calendar functionality happens; notifications, etc. generated from Google Calendar
More clarification:
Users don't need view access to the calendar
The calendar integration is irrelevant to users, they're just submitting a contact form
It appears the only required event fields are start and end time so that's easy enough to grab from a date picker I'm just lost on how to engineer the connection to our company calendar named e.g. "User Created Events".
I know this can be done with Zapier. I'd like to learn the correct way though.
Based from Calendar API Sharing and Attendees:
There are two different ways to share calendar and event data with
others.
Firstly, you can share an entire calendar, with a specified level of
access. For example, you can create a team calendar, and then do
things like:
Grant all members of your team the right to add and modify events in the calendar
Grant your boss the right to see the events on your calendar
Grant your customers the right to only see when you are free or busy, but not the details of the events
You can also adjust the access to individual events on the shared
calendar.
You can share with somebody a specific created event on a calendar using google api by going through ACL - access control list.
I use Zapier for my organization to complete the exact same scenario. Ideally the webform service you use has a built in integration with Zapier, otherwise there will be some coding involved to have this work.
Assuming your webform service has an integration with Zapier:
Trigger Event: There is likely a trigger scenario along the lines of "execute zap on submission of new record". Upon this trigger activating, depending on how your webform service sends data, you will likely receive a list of values corresponding to the data entered.
Optional Action: Depending on the consistency of the data being entered through the webform you may want to also consider adding a step using the Zapier code module. The code module allows you to take the data gathered during the trigger event and manipulate it as you see fit (I personally use this step to check that data was entered correctly). That said it is an advanced step and does require some coding experience in either javascript or python. See the Python documentation here and the Java documentation here.
Google Calendar Action: If you haven't already you will be required to authorize Zapier's access to read and write to your calendar. Zapier makes this pretty straight forward. Click the "connect account" button and a dialog window will appear asking you to log into your gmail account. After you have connected your account you can then setup your template. Using the drop downs within the template you can select what data you would like to be entered into each field. Assuming everything went correctly then you should see the information added to your calendar.
See the documentation here for further explanation.
Assuming your webform service does not have an integration with Zapier:
This is a bit trickier and will be dependent on the whether or not your webform service allows you to make POST requests based on the entering of new forms. This will as well require a good deal more programming to get up and running. Not knowing the platform you are using to capture user input forces me to make a lot of assumptions.
So assuming your webform platform has the ability to make POST requests with the data from a newly entered record, or allows you to program it to do so, you could use Zapier's webhook module as a trigger. See Zapier's webhook documentation here.
For this to work you would have to start by creating a webhook endpoint through Zapier. The endpoint is just a url that is waiting to receive data sent to it from an outside source, in this case your webform platform.
The zap template would look as follows:
Trigger Event: POST request data caught by Zapier webhook endpoint. Once the data is captured it can be used in the same way you would with a standard zap. That is to say that the data, in the form of key/value pairs, will now be populated in Zapier's drop down list you use to move information from one step to the next.
Optional Action: Once again you can leverage Zapier's code module to apply logic to the captured data.
Google Calendar Action: Same as the "Google Calendar Action" listed above.
Edit:
In re-reading your question I realize that you are looking to achieve this without using zapier. I will leave this answer up for the time being, as perhaps it will have some value to you. If not I can remove it.

Can you create Google Forms from Google Docs in an application?

I am thinking about app that will use google form and I need to create forms from that app. Is there a way how can I create form in google docs without using website but through some api or some other way?
I can offer an idea for a solution using Google App Script.
Since the beginning of 2013 you can create new forms using the App Script Forms Service API quite easily.
var form = FormApp.create(title)
.setDescription(description)
.setConfirmationMessage('Thanks for responding!')
;
The problem now is how to get that App Script running from your non App Script code.
You can use App Script to create a Web App that reacts to HTTP GET requests.
So putting it together, you may be able to create an App Script Web App that reacts to a GET request and when it gets the right URL parameters, it creates the form.
(Nov 2020) Yes, it is possible to programmatically create Google Forms. You can do it with Google Apps Script using its Forms service. You can also extend the code to read in the contents from Google Docs (with Apps Script's Document service) and use it for the creation of Google Forms.
I created a Google Workspace (formerly G Suite) Add-on, which you can think of as a Google Docs extension, called GFormIt. Its original purpose was intended for teachers to write exams/quizzes, possibly with answers, in Google Docs, then automatically convert them to Google Forms to distribute to students who submit their answers into Google Sheets (the destination for Google Forms submissions).
Furthermore, if you (the teacher) provided answers to your test questions, GFormIt would also auto-submit your answers to the Sheet as if you were a student. If you do that, and use a tool like Flubaroo to grade the exam, you could designate your row in the Sheet as “the answer key.” You can learn more about how it works, including viewing a short video, at the GFormIt page linked above.
This Google Docs add-on, along with others for Google Docs, Sheets, Slides, Forms, etc., are all certified/validated by Google and available for free to anyone from the Google Workspace Marketplace. (However, your admins may have to grant permissions for you to try to install them to your corporate Workspace account.) If interested in building your own add-on, please see the developer documentation and perhaps some of my introductory videos to get started, the most relevant being the one linked to at the top of this answer.
Apps Script is a serverless Google technology, meaning you write your code (using JavaScript) in the browser, and it is hosted by & executed on Google servers. If you wanted to create your own web app (and hosted anywhere), you would have to wait for a Google Forms REST API which does not exist at the time of this writing. (If we ever launch one, you'll find its documentation at https://developers.google.com/forms along with the others like Sheets https://developers.google.com/sheets, Gmail https://developers.google.com/gmail, Drive https://developers.google.com/drive, etc.)
Earlier this year (Mar 2022) the new Google Forms Api graduated from Beta. It is more powerful that the previous versions and caters for two main use cases:
Automated form creation and editing: Enables automated form creation
and editing. Enables rapid form generation from large volume question
banks or other data backends.
Reaction to Form responses: The API also enables developers to build
automations for acting on incoming responses. Examples include
developing real-time dashboards or visualizations and triggering
business workflows based on response data.
We have used it to build an integration that Creates documents and slides each time a form is completed: www.portant.co/google-forms-to-docs and it works really well.
I think the other key use case looks like it would be a good fit for you and others looking for a solution like this.
Cheers, James
Sorry, the API doesn't support programmatically creating forms.

Is there any quick and easy way to upload a Google Doc from SAP?

We're creating a custom table in SAP comprising all of the information we need and the customer needs the report from this table uploaded to Google Docs. We do not use Business By Design. Is there any other quicka nd easy way to upload our report?
I don't know much about SAP but the Documents List API has methods to programmatically upload a document to Google Docs: https://developers.google.com/google-apps/documents-list/.
For instance, if you can export the SAP table as a csv file, that can be automatically converted into a Google Spreadsheet during the upload process.
You could also go with a no-programming required solution and install the Google Drive app on a machine with access to the files for automatic sync up to Google Drive:
http://support.google.com/drive/bin/answer.py?hl=en&answer=2374989
suggest you take a look at the SAP Developer Network (SDN) / SAP Community Network (SCN) where there is a project called ABAP2GAPPS that has done this.
Note the ABAP2GAPPS example is a bit difficult to figure out (but you can learn a lot from it), and it also uses the OAuth2 'authorization code flow" OAuth2.0 flow/pattern, which requires an end-user 'consent' in an browser pop-up...so if you want to push up a file from ABAP automatically from a background job without end-user interaction then ABAP2GAPPS is not the full answer (but again, ABAP2GAPPS is a great example, suggest you look at it.)
We recently were able to achieve an interface from SAP ABAP to the Google Fusion Table API using OAuth2, with only about a 100 lines of ABAP...and the techniques we employed could be used on any of the Google API's...here's a link to the video:
Link to YouTube video interface ABAP to Google API
hope you find this helpful